Blob Blame History Raw
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Benjamin Marzinski <bmarzins@redhat.com>
Date: Mon, 25 Feb 2019 21:55:37 -0600
Subject: [PATCH] BZ 1673167: fixup wwid recheck

When multipathd was ignoring the failed get_uid output, there was still
a way for the wwid to get set to 0. Fix that.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 multipathd/main.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 30eb8fe..1dc53b2 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1211,9 +1211,10 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 			goto out;
 
 		strcpy(wwid, pp->wwid);
-		rc = get_uid(pp, pp->state, uev->udev);
+		get_uid(pp, pp->state, uev->udev);
 
-		if (rc == 0 && strncmp(wwid, pp->wwid, WWID_SIZE) != 0) {
+		if (strlen(pp->wwid) &&
+		    strncmp(wwid, pp->wwid, WWID_SIZE) != 0) {
 			condlog(0, "%s: path wwid changed from '%s' to '%s'. %s",
 				uev->kernel, wwid, pp->wwid,
 				(disable_changed_wwids ? "disallowing" :
@@ -1229,8 +1230,10 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 				goto out;
 			}
 		} else {
-			if (rc == 0)
+			if (strlen(pp->wwid))
 				pp->wwid_changed = 0;
+			else
+				strcpy(pp->wwid, wwid);
 			udev_device_unref(pp->udev);
 			pp->udev = udev_device_ref(uev->udev);
 			conf = get_multipath_config();
-- 
2.17.2