Blame SOURCES/0100-RHBZ-1067171-multipath-i-update.patch

f20720
---
f20720
 multipath/main.c |   25 ++++++++++++++++++++++++-
f20720
 1 file changed, 24 insertions(+), 1 deletion(-)
f20720
f20720
Index: multipath-tools-130222/multipath/main.c
f20720
===================================================================
f20720
--- multipath-tools-130222.orig/multipath/main.c
f20720
+++ multipath-tools-130222/multipath/main.c
f20720
@@ -198,6 +198,9 @@ get_dm_mpvec (vector curmp, vector pathv
f20720
 			continue;
f20720
 		}
f20720
 
f20720
+		if (conf->cmd == CMD_VALID_PATH)
f20720
+			continue;
f20720
+
f20720
 		dm_get_map(mpp->alias, &mpp->size, params);
f20720
 		condlog(3, "params = %s", params);
f20720
 		dm_get_status(mpp->alias, status);
f20720
@@ -308,7 +311,13 @@ configure (void)
f20720
 			goto out;
f20720
 		}
f20720
 		condlog(3, "scope limited to %s", refwwid);
f20720
-		if (conf->cmd == CMD_VALID_PATH) {
f20720
+		/* If you are ignoring the wwids file and find_multipaths is
f20720
+ 		 * set, you need to actually check if there are two available
f20720
+ 		 * paths to determine if this path should be multipathed. To
f20720
+ 		 * do this, we put off the check until after discovering all
f20720
+ 		 * the paths */
f20720
+		if (conf->cmd == CMD_VALID_PATH &&
f20720
+		    (!conf->find_multipaths || !conf->ignore_wwids)) {
f20720
 			if (conf->ignore_wwids ||
f20720
 			    check_wwids_file(refwwid, 0) == 0)
f20720
 				r = 0;
f20720
@@ -348,6 +357,20 @@ configure (void)
f20720
 
f20720
 	filter_pathvec(pathvec, refwwid);
f20720
 
f20720
+
f20720
+	if (conf->cmd == CMD_VALID_PATH) {
f20720
+		/* This only happens if find_multipaths is and
f20720
+ 		 * ignore_wwids is set.
f20720
+		 * If there is currently a multipath device matching
f20720
+ 		 * the refwwid, or there is more than one path matching
f20720
+ 		 * the refwwid, then the path is valid */
f20720
+		if (VECTOR_SIZE(curmp) != 0 || VECTOR_SIZE(pathvec) > 1)
f20720
+			r = 0;
f20720
+		printf("%s %s a valid multipath device path\n",
f20720
+		       conf->dev, r == 0 ? "is" : "is not");
f20720
+		goto out;
f20720
+	}
f20720
+
f20720
 	if (conf->cmd != CMD_CREATE && conf->cmd != CMD_DRY_RUN) {
f20720
 		r = 0;
f20720
 		goto out;