mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] nvme: duplicate NQNs check if devices needed
@ 2021-11-29 11:18 Liguang Zhang
  2021-11-29 16:34 ` Keith Busch
  0 siblings, 1 reply; 6+ messages in thread
From: Liguang Zhang @ 2021-11-29 11:18 UTC (permalink / raw)
  To: Keith Busch, Jens Axboe, Christoph Hellwig, Sagi Grimberg
  Cc: linux-nvme, linux-kernel, Liguang Zhang

If a device provides an NQN it is expected to be globally unique.
Unfortunately some firmware revisions for Intel P4500/P4510 and some
other old devices did not satisfy this requirement. If devices have the
same subnqn field, after a kernel upgrade from 4.19 to 5.10, if a system
has >1 affected device then only one device is enabled. Error like this:

nvme nvme2: Duplicate cntlid 0 with nvme0, rejecting
nvme nvme3: Duplicate cntlid 1 with nvme1, rejecting

In these circumstances, if subnqn did not begin with "nqn.", we assume
that devices did not need subnqn check.

Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
---
 drivers/nvme/host/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 4c63564adeaa..80abb4526932 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2587,6 +2587,9 @@ static struct nvme_subsystem *__nvme_find_get_subsystem(const char *subsysnqn)
 
 	lockdep_assert_held(&nvme_subsystems_lock);
 
+	if (strncmp(subsysnqn, "nqn.", 4))
+		return NULL;
+
 	/*
 	 * Fail matches for discovery subsystems. This results
 	 * in each discovery controller bound to a unique subsystem.
-- 
2.19.1.6.gb485710b


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

end of thread, other threads:[~2021-11-30  6:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-29 11:18 [PATCH] nvme: duplicate NQNs check if devices needed Liguang Zhang
2021-11-29 16:34 ` Keith Busch
2021-11-29 18:48   ` Chaitanya Kulkarni
2021-11-30  5:04   ` luanshi
2021-11-30  6:40     ` Christoph Hellwig
2021-11-30  6:58       ` luanshi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®