From: Caleb Sander Mateos Date: Fri, 27 Feb 2026 20:23:49 +0000 (-0700) Subject: nvme: always issue I/O Command Set specific Identify Namespace X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=823340b7e877b410a814177360df34810878e916;p=thirdparty%2Fkernel%2Flinux.git nvme: always issue I/O Command Set specific Identify Namespace 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 Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 04a8dae123333..6e108086fb763 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2356,7 +2356,7 @@ static int nvme_update_ns_info_block(struct nvme_ns *ns, } lbaf = nvme_lbaf_index(id->flbas); - if (ns->ctrl->ctratt & NVME_CTRL_ATTR_ELBAS) { + if (nvme_id_cns_ok(ns->ctrl, NVME_ID_CNS_CS_NS)) { ret = nvme_identify_ns_nvm(ns->ctrl, info->nsid, &nvm); if (ret < 0) goto out;