diff --git a/multipath/main.c b/multipath/main.c index 57a5681a8..95f850f1a 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -749,7 +749,7 @@ enum { int delegate_to_multipathd(enum mpath_cmds cmd, __attribute__((unused)) const char *dev, __attribute__((unused)) enum devtypes dev_type, - const struct config *conf) + struct config *conf) { int fd; char command[1024], *p, *reply = NULL; @@ -767,17 +767,17 @@ int delegate_to_multipathd(enum mpath_cmds cmd, } else if (cmd == CMD_FLUSH_ONE && dev && dev_type == DEV_DEVMAP) { p += snprintf(p, n, "del map %s", dev); - /* multipathd doesn't try as hard, to avoid potentially - * hanging. If it fails, retry with the regular multipath - * command */ - r = NOT_DELEGATED; + if (conf->remove_retries > 0) { + r = NOT_DELEGATED; + conf->remove_retries--; + } } else if (cmd == CMD_FLUSH_ALL) { p += snprintf(p, n, "del maps"); - /* multipathd doesn't try as hard, to avoid potentially - * hanging. If it fails, retry with the regular multipath - * command */ - r = NOT_DELEGATED; + if (conf->remove_retries > 0) { + r = NOT_DELEGATED; + conf->remove_retries--; + } } /* Add other translations here */