]> git.baikalelectronics.ru Git - kernel.git/commit
nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts()
authorUday Shankar <ushankar@purestorage.com>
Thu, 20 Jan 2022 20:17:37 +0000 (12:17 -0800)
committerChristoph Hellwig <hch@lst.de>
Thu, 3 Feb 2022 06:30:57 +0000 (07:30 +0100)
commit5eeddae9f3fedcf0d9b5a02f452ef6d777f87900
tree6033be756fc3df62fc23ccbfe0f62f53963010c2
parent3bd49c2c6de527c1fc83b0ba322db4d604c09ddd
nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts()

Controller deletion/reset, immediately followed by or concurrent with
a reconnect, is hard failing the connect attempt resulting in a
complete loss of connectivity to the controller.

In the connect request, fabrics looks for an existing controller with
the same address components and aborts the connect if a controller
already exists and the duplicate connect option isn't set. The match
routine filters out controllers that are dead or dying, so they don't
interfere with the new connect request.

When NVME_CTRL_DELETING_NOIO was added, it missed updating the state
filters in the nvmf_ctlr_matches_baseopts() routine. Thus, when in this
new state, it's seen as a live controller and fails the connect request.

Correct by adding the DELETING_NIO state to the match checks.

Fixes: 8b5fa41b4b7d ("nvme: fix deadlock in disconnect during scan_work and/or ana_work")
Cc: <stable@vger.kernel.org> # v5.7+
Signed-off-by: Uday Shankar <ushankar@purestorage.com>
Reviewed-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.h