linux/drivers/nvme/target
Sagi Grimberg 505363957f nvmet: fix nvme status code when namespace is disabled
If the user disabled a nvmet namespace, it is removed from the subsystem
namespaces list. When nvmet processes a command directed to an nsid that
was disabled, it cannot differentiate between a nsid that is disabled
vs. a non-existent namespace, and resorts to return NVME_SC_INVALID_NS
with the dnr bit set.

This translates to a non-retryable status for the host, which translates
to a user error. We should expect disabled namespaces to not cause an
I/O error in a multipath environment.

Address this by searching a configfs item for the namespace nvmet failed
to find, and if we found one, conclude that the namespace is disabled
(perhaps temporarily). Return NVME_SC_INTERNAL_PATH_ERROR in this case
and keep DNR bit cleared.

Reported-by: Jirong Feng <jirong.feng@easystack.cn>
Tested-by: Jirong Feng <jirong.feng@easystack.cn>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
History 2024-05-01 02:58:43 -07:00
..
admin-cmd.c nvmet: set maxcmd to be per controller 2024-03-02 15:18:08 -08:00
auth.c nvmet-auth: replace pr_debug() with pr_err() to report an error. 2024-05-01 02:58:42 -07:00
configfs.c nvmet: fix nvme status code when namespace is disabled 2024-05-01 02:58:43 -07:00
core.c nvmet: fix nvme status code when namespace is disabled 2024-05-01 02:58:43 -07:00
discovery.c nvmet: set maxcmd to be per controller 2024-03-02 15:18:08 -08:00
fabrics-cmd-auth.c nvme-auth: always set valid seq_num in dhchap reply 2023-11-06 08:34:20 -08:00
fabrics-cmd.c for-6.9/block-20240310 2024-03-11 11:43:44 -07:00
fc.c nvmet-fc: move RCU read lock to nvmet_fc_assoc_exists 2024-04-04 08:47:56 -07:00
fcloop.c nvme: fcloop: make fcloop_class constant 2024-03-05 07:56:21 -08:00
io-cmd-bdev.c nvme: port block device access to file 2024-02-25 12:05:24 +01:00
io-cmd-file.c nvmet: use bvec_set_page to initialize bvecs 2023-02-03 08:20:55 -07:00
Kconfig nvme: improve NVME_HOST_AUTH and NVME_TARGET_AUTH config descriptions 2023-12-04 08:39:03 -08:00
loop.c nvme: use ctrl state accessor 2024-01-29 07:02:50 -08:00
Makefile nvmet: implement basic In-Band Authentication 2022-08-02 17:14:49 -06:00
nvmet.h nvmet: fix nvme status code when namespace is disabled 2024-05-01 02:58:43 -07:00
passthru.c nvmet: set maxcmd to be per controller 2024-03-02 15:18:08 -08:00
rdma.c nvmet-rdma: remove NVMET_RDMA_REQ_INVALIDATE_RKEY flag 2024-03-21 10:46:53 -07:00
tcp.c nvmet-tcp: fix possible memory leak when tearing down a controller 2024-05-01 02:58:42 -07:00
trace.c nvmet: add tracing of zns commands 2024-03-08 06:58:20 -08:00
trace.h nvme: trace: avoid memcpy overflow warning 2024-01-05 13:16:18 -08:00
zns.c block: remove gfp_flags from blkdev_zone_mgmt 2024-02-12 08:41:16 -07:00