Blame SOURCES/0028-RHBZ-929078-refresh-udev-dev.patch

4728c8
---
4728c8
 libmultipath/discovery.c |    2 +-
4728c8
 multipathd/main.c        |   19 ++++++++++++++++++-
4728c8
 2 files changed, 19 insertions(+), 2 deletions(-)
4728c8
4728c8
Index: multipath-tools-130222/libmultipath/discovery.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/discovery.c
4728c8
+++ multipath-tools-130222/libmultipath/discovery.c
4728c8
@@ -1034,7 +1034,7 @@ pathinfo (struct path *pp, vector hwtabl
4728c8
 		}
4728c8
 	}
4728c8
 
4728c8
-	if (path_state == PATH_UP && (mask & DI_WWID) && !strlen(pp->wwid))
4728c8
+	if ((mask & DI_WWID) && !strlen(pp->wwid))
4728c8
 		get_uid(pp);
4728c8
 	if (mask & DI_BLACKLIST && mask & DI_WWID) {
4728c8
 		if (filter_wwid(conf->blist_wwid, conf->elist_wwid,
4728c8
Index: multipath-tools-130222/multipathd/main.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/multipathd/main.c
4728c8
+++ multipath-tools-130222/multipathd/main.c
4728c8
@@ -376,7 +376,7 @@ static int
4728c8
 uev_add_path (struct uevent *uev, struct vectors * vecs)
4728c8
 {
4728c8
 	struct path *pp;
4728c8
-	int ret;
4728c8
+	int ret, i;
4728c8
 
4728c8
 	condlog(2, "%s: add path (uevent)", uev->kernel);
4728c8
 	if (strstr(uev->kernel, "..") != NULL) {
4728c8
@@ -393,6 +393,23 @@ uev_add_path (struct uevent *uev, struct
4728c8
 			uev->kernel);
4728c8
 		if (pp->mpp)
4728c8
 			return 0;
4728c8
+		if (!strlen(pp->wwid)) {
4728c8
+			udev_device_unref(pp->udev);
4728c8
+			pp->udev = udev_device_ref(uev->udev);
4728c8
+			ret = pathinfo(pp, conf->hwtable,
4728c8
+				       DI_ALL | DI_BLACKLIST);
4728c8
+			if (ret == 2) {
4728c8
+				i = find_slot(vecs->pathvec, (void *)pp);
4728c8
+				if (i != -1)
4728c8
+					vector_del_slot(vecs->pathvec, i);
4728c8
+				free_path(pp);
4728c8
+				return 0;
4728c8
+			} else if (ret == 1) {
4728c8
+				condlog(0, "%s: failed to reinitialize path",
4728c8
+					uev->kernel);
4728c8
+				return 1;
4728c8
+			}
4728c8
+		}
4728c8
 	} else {
4728c8
 		/*
4728c8
 		 * get path vital state