Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: AlanCui4080 <me@alancui.cc>
To: Christoph Hellwig <hch@infradead.org>, Sagi Grimberg <sagi@grimberg.me>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme: make providing NGUID as UUID usage less scary
Date: Mon, 11 May 2026 16:59:19 +0800	[thread overview]
Message-ID: <2MLVK7hsTb2JIM2tKTgqIg@alancui.cc> (raw)
In-Reply-To: <agGQZU4NwAgSzHLD@infradead.org>

On Monday, 11 May 2026 16:16,Christoph Hellwig wrote:
> [the patch seem to be missing some maintainer Ccs]

Sorry, I've resent it.

> On Mon, May 11, 2026 at 01:19:59AM +0300, Sagi Grimberg wrote:
> > TBH, I'm not sure why should this be a warning or an info log. This looks
> > like a debug print to me.
> 
> It is worse.  For some reason the commit seems to imply the uuid
> replaces the nguid and they can be intermixed.

Which you refer to?

If it's my patch, My patch is actually intended to fix the issue where
"the kernel uses dev_warn_once, thus only reporting warnings for the
first block or drive where this problem occurs". So the key is "This
asymmetry can be misleading to users. If all devices in the system report 
the same issue, it might not be a problem, but if only one device reports it, 
it might (especially since I have two identical drives). ".

Futher more, should it be reported as a warning? The answer is No:
According to the NVM-Express-1_4 specification p.175 Figure 251:
"Bit 9 (UUID List): ...", UUID is not mandatory. And for devices below
spec revision 1.3, there is no UUID yet.

And yes?? Because according to NVMe 1.4 spec 7.10.6 UUID:
> The Universally Unique Identifier is defined in RFC4122 and con-
> tained in the Namespace Identification Descriptor
Current way how kernel generate UUID by NGUID is not compliant with RFC 4122
and NVMe spec. 
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme0n1/uuid 
00000000-0000-0000-a428-xxxxxxxxxxxx
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme0n1/nguid 
00000000-0000-0000-a428-xxxxxxxxxxxx

> We really need separate sysfs files for the different ids.  I gues we
> need to keep the existing one someone, but it is a mess.

I don't really know how and why user needs this UUID, because kernel said:

/* For backward compatibility expose the NGUID to userspace if
 * we have no UUID set
 */ 

[alan@AlanArchDesktop ~]$ ls /sys/block/nvme0n1/uuid (NVMe 1.4)
/sys/block/nvme0n1/uuid
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme0n1/uuid 
00000000-0000-0000-a428-xxxxxxxxxxxx
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme0n1/nguid 
00000000-0000-0000-a428-xxxxxxxxxxxx
[alan@AlanArchDesktop ~]$ ls /sys/block/nvme2n1/uuid (NVMe 1.3)
ls: cannot access '/sys/block/nvme2n1/uuid': No such file or directory
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme2n1/nguid 
cat: /sys/block/nvme2n1/nguid: No such file or directory
[alan@AlanArchDesktop ~]$ cat /sys/block/nvme2n1/uuid 
cat: /sys/block/nvme2n1/uuid: No such file or directory

If it's mandatory for userspace, why the nvme2n1 has not, if it's not
mandatory, why should we create the UUID sysfd attr. then put NGUID in it?
But for a NVMe 1.3 device there is both no UUID and no NGUID, while kernel
is not reporting warnings at all?

The NVMe 1.4 spec Figure. 253 said:
> If the namespace does not support an IEEE Extended Unigue ldentifier
> (i.e., EUI64 field is cleared to 0h) and does not support a Namespace
> Globally Unigue ldentifier (i.e., the NGUID field is cleared to Oh), then
> the namespace shall report a Namespace ldentification Descriptor with
> a value of type 3h.

So it's really a optional parameter right?

Alan









  reply	other threads:[~2026-05-11  8:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2MLVK7hsTb2JIM2tKTgqIg@alancui.cc \
    --to=me@alancui.cc \
    --cc=hch@infradead.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox