Skip to contentSkip to conversation

multipath: call store_pathinfo with DI_BLACKLIST

PATCH In review Benjamin Marzinski 2 participants 2 messages Jun 3, 2019 – Jun 4, 2019 Device mapper

lore
Share & tools
lore

Benjamin Marzinski

author maintainer
#0 lore raw

PATCH 1/1 multipath: call store_pathinfo with DI_BLACKLIST

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 <[email protected]>
---
 libmultipath/discovery.c  | 3 ++-
 multipathd/cli_handlers.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
libmultipath/discovery.c +2 -1
index b3dc60b1..e9411dfc 100644
@@ -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);
 }
multipathd/cli_handlers.c +1 -1
index 60e17d68..4c32d953 100644
@@ -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) {
Signature · 1 line
2.17.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Benjamin Marzinski

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.

Quoted 8 lines
Fixes ca19f865f "libmultipath: add 'cmd' as argument for

get_refwwid()"

---
 libmultipath/discovery.c  | 3 ++-
 multipathd/cli_handlers.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)