multipath: call store_pathinfo with DI_BLACKLIST
authorBenjamin Marzinski <bmarzins@redhat.com>
Mon, 3 Jun 2019 19:29:16 +0000 (14:29 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 3 Jul 2019 06:28:59 +0000 (08:28 +0200)
Commit ca19f865f moved adding DI_BLACKLIST to the pathinfo flags out of
store_pathinfo(), but it didn't add it to all of the necessary callers.
Without this, store_pathinfo() callers can do unnecessary extra work,
including running the path checker on blacklisted devices. Also, running

multipathd add path <blacklisted_path_device>

will add a blacklisted path.

Fixes: ca19f865f "libmultipath: add 'cmd' as argument for get_refwwid()"
Cc: Hannes Reinecke <hare@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/discovery.c
multipathd/cli_handlers.c

index 856c52c..51ca230 100644 (file)
@@ -134,7 +134,8 @@ path_discover (vector pathvec, struct config * conf,
                pp = find_path_by_devt(pathvec, devt);
                if (!pp)
                        return store_pathinfo(pathvec, conf,
-                                             udevice, flag, NULL);
+                                             udevice, flag | DI_BLACKLIST,
+                                             NULL);
        }
        return pathinfo(pp, conf, flag);
 }
index 60e17d6..4c32d95 100644 (file)
@@ -730,7 +730,7 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
                conf = get_multipath_config();
                pthread_cleanup_push(put_multipath_config, conf);
                r = store_pathinfo(vecs->pathvec, conf,
-                                  udevice, DI_ALL, &pp);
+                                  udevice, DI_ALL | DI_BLACKLIST, &pp);
                pthread_cleanup_pop(1);
                udev_device_unref(udevice);
                if (!pp) {