public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvme: Pad fake subsys NQN vid and ssvid with zeros
@ 2019-01-08 16:37 Keith Busch
  2019-01-09 18:50 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Keith Busch @ 2019-01-08 16:37 UTC (permalink / raw)


We need to preserve the leading zeros in the vid and ssvid when generating
a unique NQN. Truncating these may lead to naming collisions.

Signed-off-by: Keith Busch <keith.busch at intel.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 8daa13dd5c63..d8a5a6b377fd 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2186,7 +2186,7 @@ static void nvme_init_subnqn(struct nvme_subsystem *subsys, struct nvme_ctrl *ct
 
 	/* Generate a "fake" NQN per Figure 254 in NVMe 1.3 + ECN 001 */
 	off = snprintf(subsys->subnqn, NVMF_NQN_SIZE,
-			"nqn.2014.08.org.nvmexpress:%4x%4x",
+			"nqn.2014.08.org.nvmexpress:%04x%04x",
 			le16_to_cpu(id->vid), le16_to_cpu(id->ssvid));
 	memcpy(subsys->subnqn + off, id->sn, sizeof(id->sn));
 	off += sizeof(id->sn);
-- 
2.14.4

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

* [PATCH] nvme: Pad fake subsys NQN vid and ssvid with zeros
  2019-01-08 16:37 [PATCH] nvme: Pad fake subsys NQN vid and ssvid with zeros Keith Busch
@ 2019-01-09 18:50 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2019-01-09 18:50 UTC (permalink / raw)


Thanks,

applied to nvme-4.21.

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

end of thread, other threads:[~2019-01-09 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-08 16:37 [PATCH] nvme: Pad fake subsys NQN vid and ssvid with zeros Keith Busch
2019-01-09 18:50 ` Christoph Hellwig

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