From: Greg Kroah-Hartman Date: Wed, 27 Feb 2019 17:06:39 +0000 (+0100) Subject: 4.9-stable patches X-Git-Tag: v4.9.162~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6503e9496ff9ca6c7eed052141a4ca7412c5aaf;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: scsi-libsas-fix-rphy-phy_identifier-for-phys-with-end-devices-attached.patch --- diff --git a/queue-4.9/scsi-libsas-fix-rphy-phy_identifier-for-phys-with-end-devices-attached.patch b/queue-4.9/scsi-libsas-fix-rphy-phy_identifier-for-phys-with-end-devices-attached.patch new file mode 100644 index 00000000000..4e937b0b908 --- /dev/null +++ b/queue-4.9/scsi-libsas-fix-rphy-phy_identifier-for-phys-with-end-devices-attached.patch @@ -0,0 +1,85 @@ +From ffeafdd2bf0b280d67ec1a47ea6287910d271f3f Mon Sep 17 00:00:00 2001 +From: John Garry +Date: Fri, 15 Feb 2019 00:37:57 +0800 +Subject: scsi: libsas: Fix rphy phy_identifier for PHYs with end devices attached + +From: John Garry + +commit ffeafdd2bf0b280d67ec1a47ea6287910d271f3f upstream. + +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: 2908d778ab3e ("[SCSI] aic94xx: new driver") +Reported-by: dann frazier +Signed-off-by: John Garry +Reviewed-by: Jason Yan +Tested-by: dann frazier +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/libsas/sas_expander.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/scsi/libsas/sas_expander.c ++++ b/drivers/scsi/libsas/sas_expander.c +@@ -818,6 +818,7 @@ static struct domain_device *sas_ex_disc + rphy = sas_end_device_alloc(phy->port); + if (!rphy) + goto out_free; ++ rphy->identify.phy_identifier = phy_id; + + child->rphy = rphy; + get_device(&rphy->dev); +@@ -845,6 +846,7 @@ static struct domain_device *sas_ex_disc + + child->rphy = rphy; + get_device(&rphy->dev); ++ rphy->identify.phy_identifier = phy_id; + sas_fill_in_rphy(child, rphy); + + list_add_tail(&child->disco_list_node, &parent->port->disco_list); diff --git a/queue-4.9/series b/queue-4.9/series index c5c92cac45a..408661a3d23 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,3 +1,4 @@ revert-loop-fix-double-mutex_unlock-loop_ctl_mutex-in-loop_control_ioctl.patch revert-loop-get-rid-of-loop_index_mutex.patch revert-loop-fold-__loop_release-into-loop_release.patch +scsi-libsas-fix-rphy-phy_identifier-for-phys-with-end-devices-attached.patch