Skip to contentSkip to conversation

nvme: check that EUI/GUID/UUID are globally unique

PATCH Stefan 3 participants 6 messages Jun 6, 2022 NVMe

lore
Share & tools
lore

Stefan

author
#0 lore raw
Quoted 6 lines · Christoph Hellwig

Add a check to verify that the unique identifiers are unique globally in addition to the existing check that verifies that they are unique inside a single subsystem.

---

Hi list!

(not following nvme-dev, sorry if reported before)

Ran into a boot failure on my workstation today and I traced it to this commit, reverting it on v5.18.1 makes it work. Quad-nvme boot raid.

I saw some follow-ups adding quirks, so I added NVME_QUIRK_BOGUS_NID to my drives (1cc1:5350 for reference) and that worked too - if this is ok for an actual patch let me know.

Prints error "globally duplicate IDs for nsid 1". Symptom is one drive (appears to be random every boot?) not showing up in /dev/disk/by-id, other 3 are there and accessible. Happens 100%, no chance at mapping my raid.

System info:

# nvme list

Node Generic SN Model Namespace Usage Format FW Rev
------------- ----------- ------------- --------------- --------- ------------------------- ------------- --------

/dev/nvme3n1  /dev/ng3n1  PJ5220001302  XPG GAMMIX S50  1           1.00  TB /   1.00  TB   4 KiB +  0 B  EGFM11.2
/dev/nvme2n1  /dev/ng2n1  PJ5220001308  XPG GAMMIX S50  1           1.00  TB /   1.00  TB   4 KiB +  0 B  EGFM11.2
/dev/nvme1n1  /dev/ng1n1  PJ3820001439  XPG GAMMIX S50  1           1.00  TB /   1.00  TB   4 KiB +  0 B  EGFM11.2
/dev/nvme0n1  /dev/ng0n1  PJ3820001437  XPG GAMMIX S50  1           1.00  TB /   1.00  TB   4 KiB +  0 B  EGFM11.2
# cat /sys/class/nvme/nvmeX/nvmeXn1/nsid
1

Out of curiosity, I tried printk'ing the values being compared here, and it's the same for all drives:

uuid: 00000000-0000-0000-0000-000000000000
nguid: empty?
eui64: random (?), but always same on all drives

Open to provide more info,
Thanks,

~ Stefan

#1 lore raw
Quoted 6 lines · Stefan

Ran into a boot failure on my workstation today and I traced it to this commit, reverting it on v5.18.1 makes it work. Quad-nvme boot raid.

I saw some follow-ups adding quirks, so I added NVME_QUIRK_BOGUS_NID to my drives (1cc1:5350 for reference) and that worked too - if this is ok for an actual patch let me know.

Yes, please send the patch, the controller reports a non-uniqueue EUI64, the rest seems to be not reported at all and thus actually ok.

author
#2 lore raw
Quoted 5 lines · Stefan
Quoted 4 lines

Ran into a boot failure on my workstation today and I traced it to this commit, reverting it on v5.18.1 makes it work. Quad-nvme boot raid.

Quoted 7 lines
Quoted 3 lines

I saw some follow-ups adding quirks, so I added NVME_QUIRK_BOGUS_NID to my drives (1cc1:5350 for reference) and that worked too - if this is ok for an actual patch let me know.

Yes, please send the patch, the controller reports a non-uniqueue EUI64, the rest seems to be not reported at all and thus actually ok.

Will do, but just to clarify: Is this a problem with my specific drive or with the controller? FWICT my drives use a Phison PS5016-E16, which seems quite common in consumer PCIe 4.0 SSDs.

If I add the quirk for 1cc1:5350 it would only override it for this specific ADATA/XPG model, correct?

#3 lore raw
Quoted 3 lines · Stefan

Will do, but just to clarify: Is this a problem with my specific drive or with the controller? FWICT my drives use a Phison PS5016-E16, which seems quite common in consumer PCIe 4.0 SSDs.

In general ID reporting like this is a firmware issue, so it is not directly related to the controller hardware. However for cheap consumer drives most vendors simply take the default reference firmware and ship it with the minimum required changes. So if Phison fucked this up, chances are it will be in most of these controllers.

Quoted 2 lines

If I add the quirk for 1cc1:5350 it would only override it for this specific ADATA/XPG model, correct?

Yes. We have to way to find out what actual controller hardware or reference firmware a given device is based off.

maintainer
#4 lore raw
In reply to Christoph Hellwig
Quoted 10 lines · Christoph Hellwig
Quoted 6 lines · Stefan

Ran into a boot failure on my workstation today and I traced it to this commit, reverting it on v5.18.1 makes it work. Quad-nvme boot raid.

I saw some follow-ups adding quirks, so I added NVME_QUIRK_BOGUS_NID to my drives (1cc1:5350 for reference) and that worked too - if this is ok for an actual patch let me know.

Yes, please send the patch, the controller reports a non-uniqueue EUI64, the rest seems to be not reported at all and thus actually ok.

I am unable to reply to Stefan for some bizarre gpg issues...

But just fyi, this sounds like the same issue as the phison controller from a different brand reported below, so it sounds more widespread than just this particular adata model.

https://bugzilla.kernel.org/show_bug.cgi?id=216049

The reported didn't provide the device id, though, so we don't have a viable patch for that product just yet. Perhaps we could add the vid:did to some of the messages to help shorten the report-quirk cycle.

#5 lore raw
Quoted 9 lines · Keith Busch

But just fyi, this sounds like the same issue as the phison controller from a different brand reported below, so it sounds more widespread than just this particular adata model.

https://bugzilla.kernel.org/show_bug.cgi?id=216049

The reported didn't provide the device id, though, so we don't have a viable patch for that product just yet. Perhaps we could add the vid:did to some of the messages to help shorten the report-quirk cycle.

Yes, that's probably useful. I've also been wondering if we need a kernel command line interface to enable quirks for given IDs, similar to what SCSI has. With the amount of amazingly crappy consumer devices our number of quirks will keep growing exponentially unless we can finally get the NVMe interop group to actually test for these kinds of real life bug instead of silly crap like status code precedence.