device-mapper-multipath/0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch
Benjamin Marzinski b05147c356 device-mapper-multipath-0.8.5-6
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
2021-03-26 13:33:56 -05:00

41 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Wed, 24 Mar 2021 21:48:15 -0500
Subject: [PATCH] multipathd: improve getting parent udevice in rescan_path
Instead of looping through parents and checking, just call
udev_device_get_parent_with_subsystem_devtype() to get the
right one.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
multipathd/main.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index 1df69096..bc747d0e 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -822,16 +822,12 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs)
}
static void
-rescan_path(struct udev_device *parent)
+rescan_path(struct udev_device *ud)
{
- while(parent) {
- const char *subsys = udev_device_get_subsystem(parent);
- if (subsys && !strncmp(subsys, "scsi", 4))
- break;
- parent = udev_device_get_parent(parent);
- }
- if (parent)
- sysfs_attr_set_value(parent, "rescan", "1", strlen("1"));
+ ud = udev_device_get_parent_with_subsystem_devtype(ud, "scsi",
+ "scsi_device");
+ if (ud)
+ sysfs_attr_set_value(ud, "rescan", "1", strlen("1"));
}
void