All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: return 'namespace not ready' for disabled namespaces
@ 2024-08-19 12:29 Hannes Reinecke
  2024-08-19 13:17 ` Sagi Grimberg
  0 siblings, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2024-08-19 12:29 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke

When a namespace is disabled from configfs returning 'path error'
is quite an odd choice; the actual description for that error is:
'The command was not completed as a result of a controller internal
error that is specific to the controller processing the command.'
Which is not the case here; once disabled the namespace is disabled
for the entire subsystem, not just the controller.
So return 'namespace not ready' here to clarify the problem.

Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
 drivers/nvme/target/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index ed2424f8a396..d9ce1326f4ab 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -444,7 +444,7 @@ u16 nvmet_req_find_ns(struct nvmet_req *req)
 	if (unlikely(!req->ns)) {
 		req->error_loc = offsetof(struct nvme_common_command, nsid);
 		if (nvmet_subsys_nsid_exists(subsys, nsid))
-			return NVME_SC_INTERNAL_PATH_ERROR;
+			return NVME_SC_NS_NOT_READY;
 		return NVME_SC_INVALID_NS | NVME_STATUS_DNR;
 	}
 
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-22  6:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 12:29 [PATCH] nvmet: return 'namespace not ready' for disabled namespaces Hannes Reinecke
2024-08-19 13:17 ` Sagi Grimberg
2024-08-19 13:54   ` Hannes Reinecke
2024-08-19 14:22     ` Sagi Grimberg
2024-08-22  6:56       ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.