multipath -u: add DM_MULTIPATH_DEVICE_PATH=2 for "maybe"
authorMartin Wilck <mwilck@suse.com>
Fri, 13 Apr 2018 22:00:07 +0000 (00:00 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 11 May 2018 08:48:44 +0000 (10:48 +0200)
Use DM_MULTIPATH_DEVICE_PATH="2" to indicate that this might be a
valid path, but we aren't certain. This happens with find_multipaths
"smart", when the first path to a device (or a single-path
device) is encountered, and the device is neither blacklisted,
nor marked failed, nor whitelisted in the wwids file.

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
multipath/main.c

index 942caf4..f62e18a 100644 (file)
@@ -353,7 +353,7 @@ out:
 static int print_cmd_valid(int k, const vector pathvec,
                           struct config *conf)
 {
-       static const int vals[] = { 1, 0 };
+       static const int vals[] = { 1, 0, 2 };
 
        if (k < 0 || k >= sizeof(vals))
                return 1;
@@ -504,6 +504,9 @@ configure (struct config *conf, enum mpath_cmds cmd,
                 * the refwwid, then the path is valid */
                if (VECTOR_SIZE(curmp) != 0 || VECTOR_SIZE(pathvec) > 1)
                        r = 0;
+               else
+                       /* Use r=2 as an indication for "maybe" */
+                       r = 2;
                goto print_valid;
        }