diff options
author | James Smart <jsmart2021@gmail.com> | 2019-03-13 18:55:02 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-03-13 19:05:40 +0100 |
commit | 834d3710a093aa18c8aa88e6e1892180abadebaf (patch) | |
tree | 9e9d3960065ae368d5226dedd07d7dc09426b763 /drivers/nvme/target/fc.c | |
parent | nvme-fc: fix numa_node when dev is null (diff) | |
download | linux-834d3710a093aa18c8aa88e6e1892180abadebaf.tar.xz linux-834d3710a093aa18c8aa88e6e1892180abadebaf.zip |
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>
Diffstat (limited to 'drivers/nvme/target/fc.c')
0 files changed, 0 insertions, 0 deletions