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

Martin George martinus.gpy at gmail.com
Thu Mar 16 04:50:09 PDT 2023


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.

Signed-off-by: Martin George <marting at netapp.com>
---
 drivers/nvme/host/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d4be525f8100..1894aa993313 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -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);
-- 
2.34.1




More information about the Linux-nvme mailing list