Blame SOURCES/0007-multipathd-ignore-failed-wwid-recheck.patch

a1c519
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
a1c519
From: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
Date: Wed, 20 Feb 2019 17:05:08 -0600
a1c519
Subject: [PATCH] multipathd: ignore failed wwid recheck
a1c519
a1c519
If disable_changed_wwids is set, when multipathd gets a change event on
a1c519
a path, it verifies that the wwid hasn't changed in uev_update_path().
a1c519
If get_uid() failed, uev_update_path treated this as a wwid change to 0.
a1c519
This could cause paths to suddenly be dropped due to an issue with
a1c519
getting the wwid.  Even if get_uid() failed because the path was down,
a1c519
it no change uevent happend when it later became active, multipathd
a1c519
would continue to ignore the path. Also, scsi_uid_fallback() clears the
a1c519
failure return if it doesn't attempt to fallback, causing get_uid()
a1c519
to return success, when it actually failed.
a1c519
a1c519
Multipathd should neither set nor clear wwid_changed if get_uid()
a1c519
returned failure. Also, scsi_uid_fallback() should retain the old return
a1c519
value if it doesn't attempt to fallback.
a1c519
a1c519
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
a1c519
---
a1c519
 libmultipath/discovery.c | 6 +++---
a1c519
 multipathd/main.c        | 6 ++++--
a1c519
 2 files changed, 7 insertions(+), 5 deletions(-)
a1c519
a1c519
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
a1c519
index 729bcb9..b08cb2d 100644
a1c519
--- a/libmultipath/discovery.c
a1c519
+++ b/libmultipath/discovery.c
a1c519
@@ -1755,9 +1755,9 @@ get_vpd_uid(struct path * pp)
a1c519
 }
a1c519
 
a1c519
 static ssize_t scsi_uid_fallback(struct path *pp, int path_state,
a1c519
-			     const char **origin)
a1c519
+			     const char **origin, ssize_t old_len)
a1c519
 {
a1c519
-	ssize_t len = 0;
a1c519
+	ssize_t len = old_len;
a1c519
 	int retrigger;
a1c519
 	struct config *conf;
a1c519
 
a1c519
@@ -1828,7 +1828,7 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev)
a1c519
 			origin = "sysfs";
a1c519
 		}
a1c519
 		if (len <= 0 && pp->bus == SYSFS_BUS_SCSI)
a1c519
-			len = scsi_uid_fallback(pp, path_state, &origin);
a1c519
+			len = scsi_uid_fallback(pp, path_state, &origin, len);
a1c519
 	}
a1c519
 	if ( len < 0 ) {
a1c519
 		condlog(1, "%s: failed to get %s uid: %s",
a1c519
diff --git a/multipathd/main.c b/multipathd/main.c
a1c519
index 678ecf8..fd83a6a 100644
a1c519
--- a/multipathd/main.c
a1c519
+++ b/multipathd/main.c
a1c519
@@ -1234,9 +1234,11 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
a1c519
 			goto out;
a1c519
 
a1c519
 		strcpy(wwid, pp->wwid);
a1c519
-		get_uid(pp, pp->state, uev->udev);
a1c519
+		rc = get_uid(pp, pp->state, uev->udev);
a1c519
 
a1c519
-		if (strncmp(wwid, pp->wwid, WWID_SIZE) != 0) {
a1c519
+		if (rc != 0)
a1c519
+			strcpy(pp->wwid, wwid);
a1c519
+		else if (strncmp(wwid, pp->wwid, WWID_SIZE) != 0) {
a1c519
 			condlog(0, "%s: path wwid changed from '%s' to '%s'. %s",
a1c519
 				uev->kernel, wwid, pp->wwid,
a1c519
 				(disable_changed_wwids ? "disallowing" :
a1c519
-- 
a1c519
2.17.2
a1c519