Make cli_del_maps() call dm_suspend_and_flush_map() for the unknown multipath devices as well. After this change, all callers of cli_del_maps() set need_suspend, so simplify dm_flush_maps(). Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> --- libmultipath/devmapper.c | 7 ++----- libmultipath/devmapper.h | 2 +- multipath/main.c | 2 +- multipathd/cli_handlers.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 36b9d274..1646110b 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -1159,7 +1159,7 @@ dm_flush_map_nopaths(const char * mapname, #endif -int dm_flush_maps (int need_suspend, int retries) +int dm_flush_maps (int retries) { int r = 1; struct dm_task *dmt; @@ -1184,10 +1184,7 @@ int dm_flush_maps (int need_suspend, int retries) goto out; do { - if (need_suspend) - r |= dm_suspend_and_flush_map(names->name, retries); - else - r |= dm_flush_map(names->name); + r |= dm_suspend_and_flush_map(names->name, retries); next = names->next; names = (void *) names + next; } while (next); diff --git a/libmultipath/devmapper.h b/libmultipath/devmapper.h index d1790df5..1eacd966 100644 --- a/libmultipath/devmapper.h +++ b/libmultipath/devmapper.h @@ -55,7 +55,7 @@ int dm_flush_map_nopaths(const char * mapname, int deferred_remove); #define dm_suspend_and_flush_map(mapname, retries) \ _dm_flush_map(mapname, 1, 0, 1, retries) int dm_cancel_deferred_remove(struct multipath *mpp); -int dm_flush_maps (int need_suspend, int retries); +int dm_flush_maps (int retries); int dm_fail_path(const char * mapname, char * path); int dm_reinstate_path(const char * mapname, char * path); int dm_queue_if_no_path(struct multipath *mpp, int enable); diff --git a/multipath/main.c b/multipath/main.c index 9e1c5052..c51884f2 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -1075,7 +1075,7 @@ main (int argc, char *argv[]) goto out; } else if (cmd == CMD_FLUSH_ALL) { - r = dm_flush_maps(1, retries) ? RTVL_FAIL : RTVL_OK; + r = dm_flush_maps(retries) ? RTVL_FAIL : RTVL_OK; goto out; } while ((r = configure(conf, cmd, dev_type, dev)) == RTVL_RETRY) diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c index 2d90f0fe..dc547be8 100644 --- a/multipathd/cli_handlers.c +++ b/multipathd/cli_handlers.c @@ -781,7 +781,7 @@ cli_del_maps (void *v, struct strbuf *reply, void *data) i--; } /* flush any multipath maps that aren't currently known by multipathd */ - ret |= dm_flush_maps(0, 0); + ret |= dm_flush_maps(0); return ret; } -- 2.43.0