All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>, Sagi Grimberg <sagi@grimberg.me>,
	linux-nvme@lists.infradead.org, Hannes Reinecke <hare@kernel.org>
Subject: [PATCH] nvmet: return 'namespace not ready' for disabled namespaces
Date: Mon, 19 Aug 2024 14:29:17 +0200	[thread overview]
Message-ID: <20240819122917.65313-1-hare@kernel.org> (raw)

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



             reply	other threads:[~2024-08-19 12:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 12:29 Hannes Reinecke [this message]
2024-08-19 13:17 ` [PATCH] nvmet: return 'namespace not ready' for disabled namespaces Sagi Grimberg
2024-08-19 13:54   ` Hannes Reinecke
2024-08-19 14:22     ` Sagi Grimberg
2024-08-22  6:56       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240819122917.65313-1-hare@kernel.org \
    --to=hare@kernel.org \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.