libmultipath: pathinfo: skip hidden devices
authorMartin Wilck <mwilck@suse.com>
Fri, 14 Sep 2018 12:51:01 +0000 (14:51 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sun, 7 Oct 2018 07:52:13 +0000 (09:52 +0200)
Hidden block devices (in practice: members of nvme native multipath
devices) can't be used by multipath anyway. Current multipath code
(with default blacklisting) skips them, too, but emits a misleading
"blacklisted: udev property missing" message.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c

index 0b1855d..11da64b 100644 (file)
@@ -1858,9 +1858,18 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
         * limited by DI_BLACKLIST and occurs before this debug
         * message with the mask value.
         */
-       if (pp->udev && (is_claimed_by_foreign(pp->udev) ||
-                        filter_property(conf, pp->udev) > 0))
-               return PATHINFO_SKIPPED;
+       if (pp->udev) {
+               const char *hidden =
+                       udev_device_get_sysattr_value(pp->udev, "hidden");
+
+               if (hidden && !strcmp(hidden, "1")) {
+                       condlog(3, "%s: hidden", pp->dev);
+                       return PATHINFO_SKIPPED;
+               }
+               if (is_claimed_by_foreign(pp->udev) ||
+                        filter_property(conf, pp->udev) > 0)
+                       return PATHINFO_SKIPPED;
+       }
 
        if (filter_devnode(conf->blist_devnode,
                           conf->elist_devnode,