Skip to contentSkip to conversation

nvme-core: send identify with CNS 06h to IOCs alone

PATCH In review Martin George 2 participants 2 messages Mar 16, 2023 – Mar 22, 2023 NVMe

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme-core: send identify with CNS 06h to IOCs alone

Identify command with CNS 06h (i/o command set specific identify controller data structure) is supported only on i/o controllers. But nvme_init_non_mdts_limits() currently invokes this on all controllers. So correct this by ensuring this is sent to i/o controllers alone.

---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/host/core.c +2 -1
index d4be525f8100..1894aa993313 100644
@@ -3063,7 +3063,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
 	else
 		ctrl->max_zeroes_sectors = 0;
 
-	if (nvme_ctrl_limited_cns(ctrl))
+	if ((ctrl->subsys->subtype != NVME_NQN_NVME) ||
+	    (nvme_ctrl_limited_cns(ctrl)))
 		return 0;
 
 	id = kzalloc(sizeof(*id), GFP_KERNEL);
Signature · 1 line
2.34.1
#1 lore raw

Thanks, I've applied this to nvme-6.3 with a few cosmetic fixups.