linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: check for dynamic controller model before verifying cntlid
@ 2019-10-16 20:23 David Milburn
  2019-10-17 14:50 ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: David Milburn @ 2019-10-16 20:23 UTC (permalink / raw)
  To: linux-nvme; +Cc: kbusch, hch, sagi

If controller supports dynamic controller model the cntlid returned
from the identify command maybe FFFFh causing check in nvme_init_identify()
to fail which results in "nvme discover" failure.

nvme discover -t rdma -a <target_IP>
Failed to write to /dev/nvme-fabrics: Invalid argument

Signed-off-by: David Milburn <dmilburn@redhat.com>
---
 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index fd7dea36c3b6..235aa1811446 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2812,7 +2812,7 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
 		 * In fabrics we need to verify the cntlid matches the
 		 * admin connect
 		 */
-		if (ctrl->cntlid != le16_to_cpu(id->cntlid)) {
+		if (id->ctrattr && (ctrl->cntlid != le16_to_cpu(id->cntlid))) {
 			ret = -EINVAL;
 			goto out_free;
 		}
-- 
2.18.1


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-17 15:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 20:23 [PATCH] nvme: check for dynamic controller model before verifying cntlid David Milburn
2019-10-17 14:50 ` Christoph Hellwig
2019-10-17 15:08   ` David Milburn
2019-10-17 15:10     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).