diff --git a/libmultipath/devmapper.c b/libmultipath/devmapper.c index 91ff0b3..3f70e57 100644 --- a/libmultipath/devmapper.c +++ b/libmultipath/devmapper.c @@ -970,10 +970,10 @@ int dm_flush_maps (int need_suspend, int retries) if (!(names = dm_task_get_names (dmt))) goto out; + r = 0; if (!names->dev) goto out; - r = 0; do { if (need_suspend) r |= dm_suspend_and_flush_map(names->name, retries); diff --git a/multipath/main.c b/multipath/main.c index 3c3d239..607cada 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -869,9 +869,12 @@ int delegate_to_multipathd(enum mpath_cmds cmd, goto out; } - if (reply != NULL && *reply != '\0' && strcmp(reply, "ok\n")) - printf("%s", reply); - r = DELEGATE_OK; + if (reply != NULL && *reply != '\0') { + if (strcmp(reply, "fail\n")) + r = DELEGATE_OK; + if (r != NOT_DELEGATED && strcmp(reply, "ok\n")) + printf("%s", reply); + } out: FREE(reply);