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

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