John Garry
ffeafdd2bf
scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached
The sysfs phy_identifier attribute for a sas_end_device comes from the rphy
phy_identifier value.
Currently this is not being set for rphys with an end device attached, so
we see incorrect symlinks from systemd disk/by-path:
root@localhost:~# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Feb 13 12:26 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy0-lun-0-part3 -> ../../sdc3
Indeed, each sas_end_device phy_identifier value is 0:
root@localhost:/# more sys/class/sas_device/end_device-0\:0\:2/phy_identifier
0
root@localhost:/# more sys/class/sas_device/end_device-0\:0\:10/phy_identifier
0
This patch fixes the discovery code to set the phy_identifier. With this,
we now get proper symlinks:
root@localhost:~# ls -l /dev/disk/by-path/
total 0
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy10-lun-0 -> ../../sdg
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy11-lun-0 -> ../../sdh
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy2-lun-0 -> ../../sda
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy2-lun-0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0 -> ../../sdb
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy3-lun-0-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0 -> ../../sdc
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part1 -> ../../sdc1
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part2 -> ../../sdc2
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy4-lun-0-part3 -> ../../sdc3
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy5-lun-0 -> ../../sdd
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0 -> ../../sde
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part1 -> ../../sde1
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part2 -> ../../sde2
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy7-lun-0-part3 -> ../../sde3
lrwxrwxrwx 1 root root 9 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0 -> ../../sdf
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part1 -> ../../sdf1
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part2 -> ../../sdf2
lrwxrwxrwx 1 root root 10 Feb 13 11:53 platform-HISI0162:01-sas-exp0x500e004aaaaaaa1f-phy8-lun-0-part3 -> ../../sdf3
Fixes: 2908d778ab ("[SCSI] aic94xx: new driver")
Reported-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Reviewed-by: Jason Yan <yanaijie@huawei.com>
Tested-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2019-02-15 22:16:07 -05:00
..
2019-01-03 18:57:57 -08:00
2018-12-19 09:40:13 +01:00
2019-01-22 20:40:59 -05:00
2018-12-21 21:27:21 +01:00
2019-01-05 13:25:58 -08:00
2019-01-03 08:21:47 -07:00
2018-12-19 13:43:42 +01:00
2018-12-31 17:32:35 -08:00
2018-12-29 08:20:44 -07:00
2019-01-03 18:57:57 -08:00
2019-01-02 18:56:59 -08:00
2019-01-05 09:50:07 -08:00
2018-12-27 10:43:24 -08:00
2018-12-27 10:43:24 -08:00
2019-01-03 18:57:57 -08:00
2018-12-28 12:11:47 -08:00
2019-01-04 14:31:38 -08:00
2019-01-04 13:13:46 -08:00
2018-12-19 11:57:45 +01:00
2019-01-22 20:40:59 -05:00
2019-01-05 11:28:39 -08:00
2019-01-03 18:57:57 -08:00
2018-12-28 20:00:21 -08:00
2019-01-05 18:25:19 -08:00
2019-01-05 17:53:40 -08:00
2018-12-28 20:54:57 -08:00
2018-12-29 13:03:29 -08:00
2019-01-03 11:42:10 -08:00
2018-12-19 20:21:06 +01:00
2019-01-05 18:13:35 -08:00
2018-12-28 13:19:59 -08:00
2018-12-28 20:39:58 -08:00
2019-01-05 18:20:51 -08:00
2019-01-02 18:56:59 -08:00
2019-01-01 15:55:29 -08:00
2018-12-29 09:40:40 -08:00
2019-01-02 10:31:39 -08:00
2018-12-25 14:52:50 -08:00
2018-12-22 14:45:35 -07:00
2019-01-03 18:57:57 -08:00
2018-12-21 22:31:26 -06:00
2019-01-03 08:21:02 -07:00
2019-01-03 18:57:57 -08:00
2019-01-05 11:30:37 -08:00
2018-12-28 16:52:18 -08:00
2018-12-18 23:13:12 -05:00
2019-01-05 18:13:35 -08:00
2018-12-28 16:52:18 -08:00
2018-12-29 12:03:17 -08:00
2019-01-03 12:53:47 -08:00
2018-12-28 16:55:46 -08:00
2018-12-19 08:35:36 +01:00
2018-12-28 20:08:34 -08:00
2018-12-29 13:40:29 -08:00
2019-01-05 17:57:34 -08:00
2019-01-05 11:23:17 -08:00
2019-01-04 10:13:27 +00:00
2019-01-01 13:19:16 -08:00
2019-01-06 11:40:06 -08:00
2019-01-03 18:57:57 -08:00
2018-12-28 20:22:45 -08:00
2018-12-29 13:03:29 -08:00
2018-12-28 20:54:57 -08:00
2018-12-24 12:06:56 +01:00
2018-12-22 00:25:54 +09:00
2018-12-21 13:43:35 +00:00
2019-01-01 13:24:31 -08:00
2019-01-29 01:14:59 -05:00
2018-12-26 10:32:18 -08:00
2019-02-15 22:16:07 -05:00
2018-12-31 17:32:35 -08:00
2018-12-25 14:43:54 -08:00
2019-01-03 18:57:57 -08:00
2019-02-04 21:40:32 -05:00
2018-12-31 13:06:30 -08:00
2019-01-05 16:07:28 -08:00
2019-01-05 11:30:37 -08:00
2018-12-28 20:54:57 -08:00
2019-01-05 17:57:34 -08:00
2019-01-01 15:55:29 -08:00
2019-01-03 18:57:57 -08:00
2019-01-05 18:15:37 -08:00
2019-01-02 18:54:45 -08:00
2018-12-22 00:25:54 +09:00
2019-01-01 13:16:45 -08:00
2019-01-03 18:57:57 -08:00
2018-12-29 13:40:29 -08:00