From 800678326e060abad3c6ff813b307b01f7160031 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 12:15:32 +0000 Subject: Apply patch 0029-multipath-delegate-flushing-maps-to-multipathd.patch patch_name: 0029-multipath-delegate-flushing-maps-to-multipathd.patch present_in_specfile: true location_in_specfile: 29 --- diff --git a/multipath/main.c b/multipath/main.c index a208002..612c681 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -828,6 +828,20 @@ int delegate_to_multipathd(enum mpath_cmds cmd, if (cmd == CMD_CREATE && conf->force_reload == FORCE_RELOAD_YES) { p += snprintf(p, n, "reconfigure"); } + 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; + } + 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; + } /* Add other translations here */ if (strlen(command) == 0) diff --git a/multipath/multipath.8 b/multipath/multipath.8 index 8befc45..47a33f9 100644 --- a/multipath/multipath.8 +++ b/multipath/multipath.8 @@ -125,11 +125,11 @@ the system. Other operation modes are chosen by using one of the following command line switches: .TP .B \-f -Flush (remove) a multipath device map specified as parameter, if unused. +Flush (remove) a multipath device map specified as parameter, if unused. This operation is delegated to the multipathd daemon if it's running. . .TP .B \-F -Flush (remove) all unused multipath device maps. +Flush (remove) all unused multipath device maps. This operation is delegated to the multipathd daemon if it's running. . .TP .B \-l