multipath -u: treat failed wwids as invalid
authorMartin Wilck <mwilck@suse.com>
Fri, 13 Apr 2018 22:00:06 +0000 (00:00 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 11 May 2018 08:48:43 +0000 (10:48 +0200)
If a WWID has been marked as "failed", don't treat it as "valid multipath
device path" in multipath -c/-u. This is key to achieve consistency between
multipathd and udev rule processing.

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

index 59a72ed..942caf4 100644 (file)
@@ -450,8 +450,12 @@ configure (struct config *conf, enum mpath_cmds cmd,
                 * Paths listed in the wwids file are always considered valid.
                 */
                if (cmd == CMD_VALID_PATH) {
-                       if ((!find_multipaths_on(conf) && ignore_wwids_on(conf))
-                           || check_wwids_file(refwwid, 0) == 0)
+                       if (is_failed_wwid(refwwid) == WWID_IS_FAILED) {
+                               r = 1;
+                               goto print_valid;
+                       } else if ((!find_multipaths_on(conf) &&
+                                   ignore_wwids_on(conf)) ||
+                                  check_wwids_file(refwwid, 0) == 0)
                                r = 0;
                        if (r == 0 ||
                            !find_multipaths_on(conf) ||