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-22 20:40:59 -05:00
2018-12-18 23:13:12 -05:00
2019-02-01 18:04:07 -05:00
2018-12-18 23:13:12 -05:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:13:12 -05:00
2018-12-19 21:54:58 -05:00
2019-01-29 01:31:13 -05:00
2018-12-28 14:48:06 -08:00
2019-01-22 20:40:59 -05:00
2019-01-11 22:33:49 -05:00
2019-02-04 22:24:02 -05:00
2018-11-09 19:17:14 -07:00
2018-12-18 23:13:12 -05:00
2018-12-20 19:46:20 -05:00
2018-12-28 14:48:06 -08:00
2019-01-11 21:38:43 -05:00
2018-12-18 23:13:12 -05:00
2018-11-28 18:50:59 -05:00
2019-01-08 22:27:24 -05:00
2019-02-04 22:17:33 -05:00
2019-02-15 22:16:07 -05:00
2019-01-22 20:40:59 -05:00
2019-01-11 22:26:05 -05:00
2018-12-20 19:48:07 -05:00
2018-12-18 23:13:12 -05:00
2018-11-07 13:42:32 -07:00
2018-12-18 23:19:21 -05:00
2019-01-08 21:57:25 -05:00
2018-12-18 23:13:12 -05:00
2019-01-11 22:24:09 -05:00
2019-02-12 22:23:12 -05:00
2019-01-08 21:57:25 -05:00
2019-01-08 21:57:26 -05:00
2018-12-18 23:13:12 -05:00
2018-12-18 23:13:12 -05:00
2019-01-22 21:11:40 -05:00
2017-10-25 05:40:22 -04:00
2018-12-18 23:13:12 -05:00
2017-12-04 20:32:53 -05:00
2018-12-18 23:13:12 -05:00
2018-12-19 21:54:07 -05:00
2018-10-17 21:58:51 -04:00
2019-01-29 01:33:00 -05:00
2018-08-30 07:27:22 -04:00
2018-12-18 23:13:12 -05:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2018-06-19 22:02:25 -04:00
2018-10-15 23:00:38 -04:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2018-06-26 12:27:06 -04:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:13:12 -05:00
2018-03-15 00:25:37 -04:00
2018-12-18 23:13:12 -05:00
2018-10-17 21:38:20 -04:00
2018-09-25 20:45:53 -04:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2018-12-28 14:48:06 -08:00
2017-10-25 04:55:18 -04:00
2018-12-18 23:13:12 -05:00
2018-07-10 22:25:03 -04:00
2018-12-18 23:13:12 -05:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2018-12-18 23:13:12 -05:00
2018-09-21 12:35:39 -04:00
2018-12-18 23:19:21 -05:00
2018-11-06 21:31:28 -05:00
2018-12-20 20:03:55 -05:00
2018-10-15 23:00:38 -04:00
2018-11-18 15:46:03 -07:00
2018-12-20 20:03:55 -05:00
2019-02-15 22:05:04 -05:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:19:21 -05:00
2018-10-17 21:07:54 -04:00
2018-12-18 23:13:12 -05:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-28 14:48:06 -08:00
2018-10-17 21:06:49 -04:00
2018-12-19 21:43:30 -05:00
2018-10-17 21:07:54 -04:00
2018-12-18 23:13:12 -05:00
2018-11-05 22:47:38 -05:00
2018-09-28 02:17:51 -04:00
2018-06-19 22:02:25 -04:00
2018-12-18 23:19:21 -05:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-07 13:42:32 -07:00
2017-11-02 11:10:55 +01:00
2019-01-03 18:57:57 -08:00
2018-02-13 21:49:15 -05:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:13:12 -05:00
2019-01-11 22:30:51 -05:00
2017-10-05 15:01:17 +02:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-18 23:13:12 -05:00
2017-11-02 11:10:55 +01:00
2018-08-30 07:21:04 -04:00
2017-12-11 21:39:39 -05:00
2019-01-29 01:24:31 -05:00
2018-04-20 19:14:28 -04:00
2018-04-20 19:14:36 -04:00
2018-04-18 19:34:08 -04:00
2018-11-26 10:34:26 -07:00
2019-01-03 18:57:57 -08:00
2017-11-02 11:10:55 +01:00
2019-01-22 20:40:59 -05:00
2017-11-14 16:23:44 -08:00
2019-01-08 21:57:26 -05:00
2018-11-07 13:42:32 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-07 13:42:32 -07:00
2018-11-07 13:42:32 -07:00
2017-11-02 11:10:55 +01:00
2018-11-07 13:42:32 -07:00
2018-12-28 14:48:06 -08:00
2018-11-07 13:42:32 -07:00
2018-06-26 12:27:06 -04:00
2018-06-04 07:58:06 -07:00
2018-11-07 13:42:32 -07:00
2018-06-19 22:02:25 -04:00
2017-11-02 11:10:55 +01:00
2018-07-30 08:27:02 -06:00
2019-02-15 22:09:54 -05:00
2019-02-12 22:18:26 -05:00
2018-11-09 19:17:14 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2019-01-03 18:57:57 -08:00
2018-12-18 23:19:21 -05:00
2018-08-02 15:22:13 -06:00
2017-11-02 11:10:55 +01:00
2018-11-09 19:17:14 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-07 13:42:32 -07:00
2017-11-02 11:10:55 +01:00
2018-12-18 23:19:21 -05:00
2018-12-28 14:48:06 -08:00
2018-12-18 23:19:21 -05:00
2018-10-15 23:00:38 -04:00
2018-12-07 21:56:06 -05:00
2018-12-28 14:48:06 -08:00
2018-12-28 14:48:06 -08:00
2018-12-18 23:13:12 -05:00
2018-11-15 14:27:08 -05:00
2018-12-18 23:13:12 -05:00
2018-10-17 21:38:20 -04:00