]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-rdma: fix concurrent reset and reconnect
authorSagi Grimberg <sagi@grimberg.me>
Thu, 21 Dec 2017 12:54:15 +0000 (14:54 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 29 Dec 2017 09:32:58 +0000 (10:32 +0100)
commit388a055c7fce9a0a8ea40b1e128a0c2286338aa5
treecacb24c397bed920f821fffa6a826e3517f54731
parent0e079326159aef99d3559d012b4f7b01c94ee98f
nvme-rdma: fix concurrent reset and reconnect

Now ctrl state machine allows to transition from RESETTING to
RECONNECTING.  In nvme-rdma when we receive a rdma cm DISONNECTED event,
we trigger nvme_rdma_error_recovery. This happens also when we execute a
controller reset, issue a cm diconnect request and receive a cm
disconnect reply, as a result, the reset work and the error recovery work
can run concurrently.

Until now the state machine prevented from the error recovery work from
running as a result of a controller reset (RESETTING -> RECONNECTING was
not allowed).

To fix this, we adopt the FC state machine approach, we always transition
from LIVE to RESETTING and only then to RECONNECTING.  We do this both
for the error recovery work and the controller reset work:

 1. transition to RESETTING
 2. teardown the controller association
 3. transition to RECONNECTING

This will restore the protection against reset work and error recovery work
from concurrently running together.

Fixes: 0b9691c78610 ("nvme: allow controller RESETTING to RECONNECTING transition")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c