[PATCH v4 4/8] nvme: always issue I/O Command Set specific Identify Namespace

From: Caleb Sander Mateos

Date: Thu Feb 26 2026 - 14:12:51 EST


Currently, the I/O Command Set specific Identify Namespace structure is
only fetched for controllers that support extended LBA formats. This is
because struct nvme_id_ns_nvm is only used by nvme_configure_pi_elbas(),
which is only called when the ELBAS bit is set in the CTRATT field of
the Identify Controller structure.

However, the I/O Command Set specific Identify Namespace structure will
soon be used in nvme_update_disk_info(), so always try to obtain it in
nvme_update_ns_info_block(). This Identify structure is first defined in
NVMe spec version 2.0, but controllers reporting older versions could
still implement it.

Signed-off-by: Caleb Sander Mateos <csander@xxxxxxxxxxxxxxx>
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
---
drivers/nvme/host/core.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index bff6f26d7bcf..14e52b260f5d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2352,15 +2352,13 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns,
ret = -ENXIO;
goto out;
}
lbaf = nvme_lbaf_index(id->flbas);

- if (ns->ctrl->ctratt & NVME_CTRL_ATTR_ELBAS) {
- ret = nvme_identify_ns_nvm(ns->ctrl, info->nsid, &nvm);
- if (ret < 0)
- goto out;
- }
+ ret = nvme_identify_ns_nvm(ns->ctrl, info->nsid, &nvm);
+ if (ret < 0)
+ goto out;

if (IS_ENABLED(CONFIG_BLK_DEV_ZONED) &&
ns->head->ids.csi == NVME_CSI_ZNS) {
ret = nvme_query_zone_info(ns, lbaf, &zi);
if (ret < 0)
--
2.45.2