Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 616628 - sys-fs/eudev-3.2.2 creates links with wrong names under /dev/disk/by-id/
Summary: sys-fs/eudev-3.2.2 creates links with wrong names under /dev/disk/by-id/
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: eudev team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 04:06 UTC by Sven E.
Modified: 2017-09-04 00:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix for WWN links under /dev/disk/by-id (eudev-wwnfix.patch,2.33 KB, patch)
2017-04-26 21:26 UTC, Sven E.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sven E. 2017-04-26 04:06:07 UTC
eudev creates wrong names under /dev/disk/by-uuid/ for the disk's WWN. The names created by eudev should match the WWN as printed on the drive.

Reproducible: Always

Steps to Reproduce:
1. Just install eudev

Actual Results:  
wrong linknames

Expected Results:  
correct (sane) linknames

A simple example:

hdparm -I:
Logical Unit WWN Device Identifier: 50014ee1013ca11a
        NAA             : 5
        IEEE OUI        : 0014ee
        Unique ID       : 1013ca11a

50014ee1013ca11a<- that is what the WWN printed on the disk read (ignoring whitespace)

smartctl -a:
LU WWN Device Id: 5 0014ee 1013ca11a -- different spacing, same identifier-string.

eudev:
Link name created wwn-0x11608592348033929217x

in particular:
/lib/udev/ata_id -x spits out:
ID_WWN=0x11608592348033929217x

That at least explains why the name is created, but not why ata_id produces a wrong WWN string.

BTW: udev had a similiar issue a while back, see: Bug #546946

After some version changes and a udevadm trigger the links were corrected.
Comment 2 Anthony Basile gentoo-dev 2017-04-26 10:14:34 UTC
(In reply to Sven E. from comment #1)
> Reference:
> https://cgit.freedesktop.org/systemd/systemd/commit/src/udev/ata_id/ata_id.
> c?id=ec62e858734a66130f68d036c55c2050bde1e52e

Thanks, did you test that this fixes the issue?
Comment 3 Sven E. 2017-04-26 11:49:44 UTC
(In reply to Anthony Basile from comment #2)
> (In reply to Sven E. from comment #1)
> > Reference:
> > https://cgit.freedesktop.org/systemd/systemd/commit/src/udev/ata_id/ata_id.
> > c?id=ec62e858734a66130f68d036c55c2050bde1e52e
> 
> Thanks, did you test that this fixes the issue?

Not yet. Didn't have time to modify the ebuild to apply the patch. But since it was a change to ata_id at the time when the problem disappeared and it changes the printf formatting, I thought it must have been the right one.

Additionally, the commit has:
https://bugzilla.redhat.com/show_bug.cgi?id=1227503
as reference

Which describes ecatly the bug I am seeing, it seems the (wrong) output is a decimal representation of the hex WWN.

Darn, now that I looked at it again, there's more to it, it seems this change only fixes the decimal (instead of correct hex) output, but the words are still in the wrong order.

If it is okay for you, I'll look into this later today or tomorrow.
Comment 4 Sven E. 2017-04-26 21:26:04 UTC
Created attachment 470986 [details, diff]
Fix for WWN links under /dev/disk/by-id

Patch fixing up ata_id's WWN output on which udev build it's /dev/disk/by-id/ links. Includes extra rules to keep the old faulty wwn links in place to make sure people using them don't run into problems.
Comment 6 Sven E. 2017-04-26 21:36:36 UTC
With proposed patch ata_id outputs:
ID_WWN=0x50014ee1013ca11a <- the result we really wanted.
ID_WWN_WITH_EXTENSION=0x50014ee1013ca11a
ID_WWN_WITH_EXTENSION_REVERSED_DO_NOT_USE=0x11608592348033929217x <- old broken name based on decimal representation
Comment 7 Anthony Basile gentoo-dev 2017-05-01 14:49:51 UTC
(In reply to Sven E. from comment #6)
> With proposed patch ata_id outputs:
> ID_WWN=0x50014ee1013ca11a <- the result we really wanted.
> ID_WWN_WITH_EXTENSION=0x50014ee1013ca11a
> ID_WWN_WITH_EXTENSION_REVERSED_DO_NOT_USE=0x11608592348033929217x <- old
> broken name based on decimal representation

the patch is in with eudev-3.2.2-r1.  i have yet to add it to the git repo.  let me know if there are any issues.  it passed a compile test.
Comment 8 Anthony Basile gentoo-dev 2017-09-03 18:19:47 UTC
(In reply to Sven E. from comment #4)
> Created attachment 470986 [details, diff] [details, diff]
> Fix for WWN links under /dev/disk/by-id
> 
> Patch fixing up ata_id's WWN output on which udev build it's
> /dev/disk/by-id/ links. Includes extra rules to keep the old faulty wwn
> links in place to make sure people using them don't run into problems.

I used upstream's patch to fix this in eudev-3.2.3.  Can you test that out and see if the problem is fixed there.
Comment 9 Sven E. 2017-09-04 00:10:07 UTC
(In reply to Anthony Basile from comment #8)
> (In reply to Sven E. from comment #4)
> > Created attachment 470986 [details, diff] [details, diff] [details, diff]
> > Fix for WWN links under /dev/disk/by-id
> > 
> > Patch fixing up ata_id's WWN output on which udev build it's
> > /dev/disk/by-id/ links. Includes extra rules to keep the old faulty wwn
> > links in place to make sure people using them don't run into problems.
> 
> I used upstream's patch to fix this in eudev-3.2.3.  Can you test that out
> and see if the problem is fixed there.

I'm a little confused, aren't you part of the eudev upstream team?

Anyhow, the ouput of ata_id seems correct and the links in /dev/disk/by-id/ look good too.
Comment 10 Anthony Basile gentoo-dev 2017-09-04 00:40:00 UTC
(In reply to Sven E. from comment #9)
> (In reply to Anthony Basile from comment #8)
> > (In reply to Sven E. from comment #4)
> > > Created attachment 470986 [details, diff] [details, diff] [details, diff] [details, diff]
> > > Fix for WWN links under /dev/disk/by-id
> > > 
> > > Patch fixing up ata_id's WWN output on which udev build it's
> > > /dev/disk/by-id/ links. Includes extra rules to keep the old faulty wwn
> > > links in place to make sure people using them don't run into problems.
> > 
> > I used upstream's patch to fix this in eudev-3.2.3.  Can you test that out
> > and see if the problem is fixed there.
> 
> I'm a little confused, aren't you part of the eudev upstream team?

I meant systemd's commit.  So when *I* say upstream I mean systemd ;)

> 
> Anyhow, the ouput of ata_id seems correct and the links in /dev/disk/by-id/
> look good too.

Good.  Note that 3.2.3 is currently masked because I got a report of a boot failure.  I'm not sure its eudev's fault yet, but to be safe, I can leave it in the tree masked for a while until I'm convinced its okay.
Comment 11 Sven E. 2017-09-04 00:58:47 UTC
(In reply to Anthony Basile from comment #10)
> I meant systemd's commit.  So when *I* say upstream I mean systemd ;)
> 

Ah, makes sense ;-).

> > 
> > Anyhow, the ouput of ata_id seems correct and the links in /dev/disk/by-id/
> > look good too.
> 
> Good.  Note that 3.2.3 is currently masked because I got a report of a boot
> failure.  I'm not sure its eudev's fault yet, but to be safe, I can leave it
> in the tree masked for a while until I'm convinced its okay.

Fine with me, I had the opportunity to reboot the system and I can definately state that all links for WWNS of (S)ATA-drives are created correctly and as expected.

Thanks for your effort.