On Wed, 2020-11-11 at 07:54 +0100, Hannes Reinecke wrote: > On 11/11/20 4:05 AM, Martin K. Petersen wrote: > > Martin, > > > > > The current code would use the first descriptor, because it's > > > longer > > > than the NAA descriptor. But this is wrong, the kernel is > > > supposed to > > > prefer NAA descriptors over T10 vendor ID. Designator length > > > should > > > only be used to compare designators of the same type. > > > > > > This patch addresses the issue by separating designator priority > > > and > > > length. > > > > I am concerned that we're going to break existing systems since > > their > > /dev/disk/by-* names might change as a result of this. Thoughts? > > > No, this shouldn't happen. With the standard udev rules we're > creating > symlinks for all possible VPD designators, so they don't change. Right. On distributions using either udev's scsi_id or the standard rules shipped with sg3_utils for determining WWIDs, nothing should change. With this patch, the kernel's logic would eventually match the logic of the udev rules, which is a good thing. In the long run, we could finally ditch the complexity of the udev rules and rely on the kernel to get the wwid right. That would be a big step forward for device identification, wrt both reliablity and speed. Only distributions using non-standard udev rules (generating /dev/disk/by-wwid from the "wwid" attribute) would be affected. I don't know if any such distribution currently exist, I haven't seen one. Even those would only be affected in certain cases like the one I showed in the commit message. If this truly worries you, we could introduce a new sysfs attribute besides "wwid". But I suppose that would rather confuse people. I strongly believe we should have a sysfs attribute that reliably provides the "right" WWID to user space. Regards, Martin