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

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