[dm-devel] [PATCH 15/33] libmultipath: move suspend logic to _dm_flush_map

Martin Wilck mwilck at suse.com
Wed Apr 12 20:54:14 UTC 2017


On Wed, 2017-04-05 at 17:44 -0500, Benjamin Marzinski wrote:
> On Tue, Feb 28, 2017 at 05:23:11PM +0100, Martin Wilck wrote:
> > From: Martin Wilck <mwilck at suse.de>
> > 
> > The function dm_suspend_and_flush() introduced in 9a4ff93
> > tries to remove child maps (partitions) after suspending
> > the mpath device. This may lock up if removing the partitions
> > requires I/O. It's better to use the following sequence
> > of actions: 1) clear queue_if_no_path; 2) remove partitions;
> > 3) suspend; 4) remove (or resume and restore queue_if_no_path
> > in case of failure).
> > 
> > This patch modifies the implementation by moving the
> > queue_if_no_path/suspend logic into _dm_flush_map().
> > A call to _dm_flush_map() with need_suspend=1 replaces
> > the previous call to dm_suspend_and_flush().
> > 
> > With this change, the mpath device is only suspended after
> > removing partmaps, avoiding the deadlock.
> 
> This patch drops support for disabling partitions, by removing
> -       /* if the device currently has no partitions, do not
> -          run kpartx on it if you fail to delete it */
> -       if (do_foreach_partmaps(mapname, has_partmap, NULL) == 0)
> -               udev_flags |= MPATH_UDEV_NO_KPARTX_FLAG;

Sorry, this was an oversight when I forward-ported my patch from our
code base to upstream. I will submit a fix.

Martin

-- 
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)




More information about the dm-devel mailing list