Change patch format to remove Git version * Patches 0001-0122 only have the patch format modified Update to the head of the upstream staging branch plus redhat patches * Patches 0123-0134 & 1036-0142 are from the upstream staging branch * Patches 0143-1046 have been submitted upstream * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules. Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL value from udev. Rename files * Previous patches 0123-0132 are now patches 1035 & 0147-0155
55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martin Wilck <mwilck@suse.com>
|
|
Date: Fri, 13 Nov 2020 22:38:21 +0100
|
|
Subject: [PATCH] libmultipath: sysfs_set_nexus_loss_tmo(): support SAS
|
|
expanders
|
|
|
|
With SAS expanders, SAS node names have 3 digits. libmultipath
|
|
would fail to discover the sas_end_device matching a given SCSI
|
|
target in this case. Fix it.
|
|
|
|
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
libmultipath/discovery.c | 24 +++++++++++++++++++-----
|
|
1 file changed, 19 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
|
index 6d74cc07..921025d4 100644
|
|
--- a/libmultipath/discovery.c
|
|
+++ b/libmultipath/discovery.c
|
|
@@ -789,14 +789,28 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
|
|
static void
|
|
sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
|
|
{
|
|
- struct udev_device *sas_dev = NULL;
|
|
- char end_dev_id[64];
|
|
+ struct udev_device *parent, *sas_dev = NULL;
|
|
+ const char *end_dev_id = NULL;
|
|
char value[11];
|
|
+ static const char ed_str[] = "end_device-";
|
|
|
|
- if (mpp->dev_loss == DEV_LOSS_TMO_UNSET)
|
|
+ if (!pp->udev || mpp->dev_loss == DEV_LOSS_TMO_UNSET)
|
|
return;
|
|
- sprintf(end_dev_id, "end_device-%d:%d",
|
|
- pp->sg_id.host_no, pp->sg_id.transport_id);
|
|
+
|
|
+ for (parent = udev_device_get_parent(pp->udev);
|
|
+ parent;
|
|
+ parent = udev_device_get_parent(parent)) {
|
|
+ const char *ed = udev_device_get_sysname(parent);
|
|
+
|
|
+ if (!strncmp(ed, ed_str, sizeof(ed_str) - 1)) {
|
|
+ end_dev_id = ed;
|
|
+ break;
|
|
+ }
|
|
+ }
|
|
+ if (!end_dev_id) {
|
|
+ condlog(1, "%s: No SAS end device", pp->dev);
|
|
+ return;
|
|
+ }
|
|
sas_dev = udev_device_new_from_subsystem_sysname(udev,
|
|
"sas_end_device", end_dev_id);
|
|
if (!sas_dev) {
|