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