Skip to content

Commit 6a51abd

Browse files
ps-ushankarChristoph Hellwig
authored andcommitted
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: ecca390 ("nvme: fix deadlock in disconnect during scan_work and/or ana_work") Cc: <[email protected]> # v5.7+ Signed-off-by: Uday Shankar <[email protected]> Reviewed-by: James Smart <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent b6bb172 commit 6a51abd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/host/fabrics.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ nvmf_ctlr_matches_baseopts(struct nvme_ctrl *ctrl,
170170
struct nvmf_ctrl_options *opts)
171171
{
172172
if (ctrl->state == NVME_CTRL_DELETING ||
173+
ctrl->state == NVME_CTRL_DELETING_NOIO ||
173174
ctrl->state == NVME_CTRL_DEAD ||
174175
strcmp(opts->subsysnqn, ctrl->opts->subsysnqn) ||
175176
strcmp(opts->host->nqn, ctrl->opts->host->nqn) ||

0 commit comments

Comments
 (0)