Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvme: make providing NGUID as UUID usage less scary
@ 2026-05-07 16:36 AlanCui4080
  2026-05-07 23:33 ` [PATCH V2] " AlanCui4080
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: AlanCui4080 @ 2026-05-07 16:36 UTC (permalink / raw)
  To: linux-nvme, Keith Busch; +Cc: linux-kernel

Hi, 

> From: Keith Busch <kbusch@kernel.org>
> 
> The warning is a bit alarming, and it only prints for the very first
> non-sgl capable device that receives a passthrough command. Just log an
> informational message on initial discovery for every device.

Since we decide to show this warning at device initial discovery stage,
here are some similar warnings that I think are essentially the same.

grep -C3 -rn "dev_warn_once" ./drivers/nvme/*
```
./drivers/nvme/host/sysfs.c-147-         * we have no UUID set
./drivers/nvme/host/sysfs.c-148-         */
./drivers/nvme/host/sysfs.c-149-        if (uuid_is_null(&ids->uuid)) {
./drivers/nvme/host/sysfs.c:150:                dev_warn_once(dev,
./drivers/nvme/host/sysfs.c-151-                        "No UUID available providing old NGUID\n");
./drivers/nvme/host/sysfs.c-152-                return sysfs_emit(buf, "%pU\n", ids->nguid);
./drivers/nvme/host/sysfs.c-153-        }
```

This warning will only complain for the first partition of the first device also.
And for NVMe devices, according to the NVM-Express-1_4 specification p.175 Figure 251:
"Bit 9 (UUID List): ...", UUID is not mandatory i guess. So let's degrade it into a
informational message on initial discovery for every device.

Signed-off-by: Alan Cui <me@alancui.cc>
---
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 3fdcd73b9546..c432d8bc7b62 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4296,6 +4296,10 @@ static void nvme_validate_ns(struct nvme_ns *ns, struct nvme_ns_info *info)
                goto out;
        }
 
+       if (uuid_is_null(&info->ids.uuid)) {
+               dev_info(ns->ctrl->device, "No UUID available, uuid_show providing old NGUID\n");
+       }
+
        ret = nvme_update_ns_info(ns, info);
 out:
        /*
diff --git a/drivers/nvme/host/sysfs.c b/drivers/nvme/host/sysfs.c
index 29430949ce2f..839a36c22ebf 100644
--- a/drivers/nvme/host/sysfs.c
+++ b/drivers/nvme/host/sysfs.c
@@ -147,8 +147,6 @@ static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
         * we have no UUID set
         */
        if (uuid_is_null(&ids->uuid)) {
-               dev_warn_once(dev,
-                       "No UUID available providing old NGUID\n");
                return sysfs_emit(buf, "%pU\n", ids->nguid);
        }
        return sysfs_emit(buf, "%pU\n", &ids->uuid);

--
2.54.0




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

end of thread, other threads:[~2026-05-12  6:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 16:36 [PATCH] nvme: make providing NGUID as UUID usage less scary AlanCui4080
2026-05-07 23:33 ` [PATCH V2] " AlanCui4080
2026-05-10 22:19 ` [PATCH] " Sagi Grimberg
2026-05-11  7:59   ` AlanCui4080
2026-05-11  8:16   ` Christoph Hellwig
2026-05-11  8:59     ` AlanCui4080
2026-05-11  9:16       ` AlanCui4080
2026-05-11 12:22       ` Christoph Hellwig
2026-05-11 14:48     ` Keith Busch
2026-05-12  6:02       ` Christoph Hellwig
2026-05-11  8:29 ` [PATCH RFC V2 RESEND] " AlanCui4080
2026-05-11 11:26   ` AlanCui4080

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