Re: [PATCH 1/2] nvme: check duplicate unique identifiers in order

John Meneghini
2025-05-12T15:44:03Z

On 5/9/25 11:33 AM, Keith Busch wrote:
> On Fri, May 09, 2025 at 11:16:27AM -0400, Bryan Gurney wrote:
>> + if (has_uuid) {
>> + list_for_each_entry(h, &subsys->nsheads, entry)
>> + if (uuid_equal(&ids->uuid, &h->ids.uuid))
>> + return -EINVAL;
>> + return 0;
>> + }
> You're returning success too early here. It may have a unique uuid, but
> that doesn't mean we don't want to check for nguid and eui64 too.

That's the point of this patch. Once we find a unique id we stop and return before checking the lower precedent IDs.

As it turns out more that one drive reports multiple IDs, but the lower precedent IDs are not unique. We've found this to be
especially true with drives that support namespace management. When you start creating more NSIDs, the drive creates new and
unique NGIUD for each new namepspace, but the EUI64 is duplicated/the same.

> If those are not unique, they need to be blanked out to make sure we don't
> expose these on the namespace's sysfs attributes.

OK, we can add another patch that blanks out the lower precedent/invalid IDs.

Will that work?

/John