ATA drive /dev/disk/by-path/ incorrect due to kernel change

Bug #1283303 reported by Lucas Magasweran
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
udev (Ubuntu)
Invalid
Undecided
Martin Pitt

Bug Description

Starting in Ubuntu 12.04.3 the kernel commit http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a changed the ATA host topology changed. This was done to match the single host to target topology of SCSI/SAS instead of having a single host with multiple ports.

As a result, when a drive is detected by udev the path ID is determined and assumes a multi-port host that must be rebased. This results in /dev/disk/by-path/ nodes that overlap. For example, the following shows two different disks, sdb and sdc, that have the same scsi-0:0:0:0 path.

# Before inserting second disk:

ubuntu@ubuntu:~$ ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Feb 21 15:57 pci-0000:00:1a.7-usb-0:5:1.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 21 15:57 pci-0000:00:1a.7-usb-0:5:1.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part6 -> ../../sdb6

# After inserting second disk:

ubuntu@ubuntu:~$ ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Feb 21 15:57 pci-0000:00:1a.7-usb-0:5:1.0-scsi-0:0:0:0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 21 15:57 pci-0000:00:1a.7-usb-0:5:1.0-scsi-0:0:0:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part3 -> ../../sdb3
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Feb 21 23:58 pci-0000:11:02.0-scsi-0:0:0:0-part6 -> ../../sdb6

I have a fix proposed and will attach a patch. I have tested it on all 12.04 releases including 12.04.4.

Tags: patch precise
Revision history for this message
Lucas Magasweran (lucasrangit) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "udev_ata_path_id_rebase_fix.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
tags: added: precise
Changed in udev (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

Which udev version did you do this patch against? Ubuntu 12.04 currently has 175-0ubuntu9.4, and it does not have this code at all. In particular, "This is true for Ubuntu 12.04.3 (quantal)" is wrong (12.04.x is precise, not quantal), and 12.04's udev does not have the /ata check at all. This was only introduced later on in saucy (13.10) when we moved to systemd's udev version.

This does have this check, just at a different position:

        /*
         * We do not support the ATA transport class, it uses global counters
         * to name the ata devices which numbers spread across multiple
         * controllers.
         *
         * The real link numbers are not exported. Also, possible chains of ports
         * behind port multipliers cannot be composed that way.
         *
         * Until all that is solved at the kernel level, there are no by-path/
         * links for ATA devices.
         */
        if (strstr(name, "/ata") != NULL) {
                parent = NULL;
                goto out;
        }

Changed in udev (Ubuntu):
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

This has not gotten any response in 6 weeks, so closing for now. When you respond, I'll reopen. Thanks!

Changed in udev (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.