linux/drivers/nvme/host
James Smart 834d3710a0 nvme-fc: reject reconnect if io queue count is reduced to zero
If:

 - A successful connect has occurred with an io queue count greater than
   zero and namespaces detected and running.
 - An error or something occurs which causes a termination of the prior
   association and then starts a reconnect,
 - The reconnect then creates a new controller, but for whatever reason,
   nvme_set_queue_count() results in io queue count set to zero.  This
   will skip io queue and tag set changes.
 - But... the controller will transition to live, calling
   nvme_start_ctrl, which calls nvme_start_queues(), which then releases
   I/Os into the transport which then sends them to the driver.

As there are no queues, things eventually hit the driver looking for a
handle, which was cleared when the original controller was reset, and it
can't proceed. Worst case, things progress, but everything fails.

In the failing scenario, the nvme_set_features(NVME_FEAT_NUM_QUEUES)
command actually failed with a NVME_SC_INTERNAL error.  For some reason,
although nvme_set_queue_count() saw the error and set io queue count to
zero, it doesn't return a failure status to the transport, which allows
the transport to continue using the controller.

Fix the problem by simply rejecting the new association if at least 1
I/O queue can't be created. The association reject will fail the
reconnect attempt and fall into the reconnect retry policy.

Signed-off-by: James Smart <jsmart2021@gmail.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-03-13 12:05:40 -06:00
..
core.c nvme: update comment to make the code easier to read 2019-03-13 12:05:39 -06:00
fabrics.c nvme-fabrics: convert to SPDX identifiers 2019-02-20 07:22:13 -07:00
fabrics.h nvme-fabrics: convert to SPDX identifiers 2019-02-20 07:22:13 -07:00
fault_inject.c nvme: convert to SPDX identifiers 2019-02-20 07:22:28 -07:00
fc.c nvme-fc: reject reconnect if io queue count is reduced to zero 2019-03-13 12:05:40 -06:00
Kconfig nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
lightnvm.c nvme-lightnvm: convert to SPDX identifiers 2019-02-20 07:22:22 -07:00
Makefile nvme-tcp: add NVMe over TCP host driver 2018-12-13 09:58:58 +01:00
multipath.c nvme: convert to SPDX identifiers 2019-02-20 07:22:28 -07:00
nvme.h nvme: convert to SPDX identifiers 2019-02-20 07:22:28 -07:00
pci.c nvme-pci: convert to SPDX identifiers 2019-02-20 07:22:25 -07:00
rdma.c nvme-rdma: use nr_phys_segments when map rq to sgl 2019-02-21 06:39:20 -07:00
tcp.c nvme: remove the .stop_ctrl callout 2019-02-04 15:41:25 +01:00
trace.c nvme: add get-feature to admin cmds tracer 2019-03-13 12:05:39 -06:00
trace.h nvme-trace: fix cdw10 buffer overrun 2019-03-13 12:05:39 -06:00