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

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