On Tue, 2023-12-12 at 18:53 -0500, Benjamin Marzinski wrote: > When the multipath command tries to delete a multipath device, it > first > disables queueing and then suspends the device to force the IOs to > get > flushed. Then it attempts to delete the device and any kpartx > partitions. multipathd, on the other hand, simply tries to delete > the > device and kpartx partitions, without disabling queueing or > suspending. > If there are no paths but there is outstanding IO, multipathd will > hang > trying to delete the last kpartx device. This is because it must be > the > last opener of the multipath device (multipath won't try to delete > the > device if it has any openers besides the kpartx devices) and the > kernel > will not allow the last opener of a block device to close until all > the > outstanding IO is flushed. This hang can be avoided if multipathd > calls > dm_suspend_and_flush_map() like the multipath command does, instead > of > dm_flush_map(). > > Signed-off-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> Reviewed-by: Martin Wilck <mwilck@xxxxxxxx>