From: Guixin Liu <kanie@linux.alibaba.com>
To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me,
kch@nvidia.com
Cc: linux-nvme@lists.infradead.org
Subject: [PATCH RFC 2/3] nvme: query independent identify ns by default
Date: Mon, 4 Nov 2024 16:55:01 +0800 [thread overview]
Message-ID: <20241104085524.118221-3-kanie@linux.alibaba.com> (raw)
In-Reply-To: <20241104085524.118221-1-kanie@linux.alibaba.com>
Query independent identify ns by default, if returning fail,
go back to sending the "identify namespace data structure for the
specified NSID or the namespace capabilities for the NVM Command
Set(cns = 0)".
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
---
drivers/nvme/host/core.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index eed41d4d2599..563abc0cb4a1 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4018,7 +4018,7 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
{
struct nvme_ns_info info = { .nsid = nsid };
struct nvme_ns *ns;
- int ret;
+ int ret = 1;
if (nvme_identify_ns_descs(ctrl, &info))
return;
@@ -4034,10 +4034,9 @@ static void nvme_scan_ns(struct nvme_ctrl *ctrl, unsigned nsid)
* data structure to find all the generic information that is needed to
* set up a namespace. If not fall back to the legacy version.
*/
- if ((ctrl->cap & NVME_CAP_CRMS_CRIMS) ||
- (info.ids.csi != NVME_CSI_NVM && info.ids.csi != NVME_CSI_ZNS))
+ if (nvme_id_cns_ok(ctrl, NVME_ID_CNS_NS_CS_INDEP))
ret = nvme_ns_info_from_id_cs_indep(ctrl, &info);
- else
+ if (ret > 0)
ret = nvme_ns_info_from_identify(ctrl, &info);
if (info.is_removed)
--
2.43.0
next prev parent reply other threads:[~2024-11-04 8:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 8:54 [PATCH RFC 0/3] set nvme ns's vwc respectively Guixin Liu
2024-11-04 8:55 ` [PATCH RFC 1/3] nvme: check ns's volatile write cache not present Guixin Liu
2024-11-05 11:12 ` Christoph Hellwig
2024-11-04 8:55 ` Guixin Liu [this message]
2024-11-05 11:11 ` [PATCH RFC 2/3] nvme: query independent identify ns by default Christoph Hellwig
2024-11-05 20:03 ` Keith Busch
2024-11-06 1:52 ` Guixin Liu
2024-11-04 8:55 ` [PATCH RFC 3/3] nvmet: report ns's vwc not present Guixin Liu
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=20241104085524.118221-3-kanie@linux.alibaba.com \
--to=kanie@linux.alibaba.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox