← Back to team overview

touch-packages team mailing list archive

[Bug 1321816] Re: /dev/disk/by-path link for scsi disks always has host "0", causing conflicts

 

Debugging notes:

       name = udev_device_get_sysname(parent);
        if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
                return NULL;

This works fine, host is "10" in the scsi_debug case above.

But then the code below which does "Rebase host offset to get the local
relative number" turns host into a "0" as 10 is the smallest host number
on that device. This code is a bit dubious to me, I'll ask Kay.

** Summary changed:

- /dev/disk/by-path link for scsi disks always has host "0", causing conflicts
+ [udev] /dev/disk/by-path link for scsi disks always has host "0", causing conflicts

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1321816

Title:
  [udev] /dev/disk/by-path link for scsi disks always has host "0",
  causing conflicts

Status in “systemd” package in Ubuntu:
  Triaged

Bug description:
  The /dev/disk/by-path links to scsi disks are supposed to be of the
  form "scsi-$host:$bus:$device$lun".  The host portion is always zero,
  leading to duplicates from different hosts.  It appears these numbers
  are pulled from ID_PATH, and I can't figure out where this variable
  comes from.

  I noticed this while playing around with the lio fake scsi target
  adapter.  Here is the full udev info on a disk created on such an
  adapter.  As you can see, it has been assigned scsi host id 13, so
  that is what it should be using for the $host digit, rather than zero.

  P: /devices/tcm_loop_0/tcm_loop_adapter_5/host13/target13:0:1/13:0:1:0/block/sdg
  N: sdg
  S: disk/by-path/scsi-0:0:1:0
  E: DEVLINKS=/dev/disk/by-path/scsi-0:0:1:0
  E: DEVNAME=/dev/sdg
  E: DEVPATH=/devices/tcm_loop_0/tcm_loop_adapter_5/host13/target13:0:1/13:0:1:0/block/sdg
  E: DEVTYPE=disk
  E: ID_BUS=scsi
  E: ID_MODEL=FILEIO
  E: ID_MODEL_ENC=FILEIO\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
  E: ID_PART_TABLE_TYPE=dos
  E: ID_PATH=scsi-0:0:1:0
  E: ID_PATH_TAG=scsi-0_0_1_0
  E: ID_REVISION=4.0
  E: ID_SCSI=1
  E: ID_TYPE=disk
  E: ID_VENDOR=LIO-ORG
  E: ID_VENDOR_ENC=LIO-ORG\x20
  E: MAJOR=8
  E: MINOR=96
  E: SUBSYSTEM=block
  E: USEC_INITIALIZED=400656927711
  E: nomdmonddf=1
  E: nomdmonisw=1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1321816/+subscriptions