linux/drivers/nvme/host
Uday Shankar 6a51abdeb2 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: ecca390e80 ("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>
2022-02-03 07:30:57 +01:00
..
core.c nvme: fix a possible use-after-free in controller reset during load 2022-02-02 09:19:05 +01:00
fabrics.c nvme-fabrics: remove the unneeded ret variable in nvmf_dev_show 2022-01-27 08:17:17 +01:00
fabrics.h nvme-fabrics: fix state check in nvmf_ctlr_matches_baseopts() 2022-02-03 07:30:57 +01:00
fault_inject.c block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
fc.c for-5.16/drivers-2021-10-29 2021-11-01 09:27:38 -07:00
fc.h nvme-fc: Update header and host for common definitions for LS handling 2020-05-09 16:18:33 -06:00
hwmon.c nvme-hwmon: Return error code when registration fails 2021-03-05 13:41:03 +01:00
ioctl.c remove the lightnvm subsystem 2021-08-14 15:54:09 -06:00
Kconfig nvme: Have NVME_FABRICS select NVME_CORE instead of transport drivers 2021-08-16 21:03:18 +02:00
Makefile remove the lightnvm subsystem 2021-08-14 15:54:09 -06:00
multipath.c for-5.17/drivers-2022-01-11 2022-01-12 10:35:23 -08:00
nvme.h for-5.17/drivers-2022-01-11 2022-01-12 10:35:23 -08:00
pci.c nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs 2022-01-27 08:17:14 +01:00
rdma.c nvme-rdma: fix possible use-after-free in transport error_recovery work 2022-02-02 09:19:07 +01:00
tcp.c nvme-tcp: fix possible use-after-free in transport error_recovery work 2022-02-02 09:19:07 +01:00
trace.c nvme: add set feature tracing support 2021-08-16 14:42:23 +02:00
trace.h block: remove the ->rq_disk field in struct request 2021-11-29 06:41:29 -07:00
zns.c nvme: report write pointer for a full zone as zone start + zone len 2021-12-06 08:52:08 +01:00