[dm-devel] [PATCH 4/7] multipathd: add "del maps" multipathd command

Martin Wilck Martin.Wilck at suse.com
Fri Jun 19 13:35:36 UTC 2020


On Thu, 2020-06-18 at 18:12 -0500, Benjamin Marzinski wrote:
> On Thu, Jun 18, 2020 at 08:37:20PM +0000, Martin Wilck wrote:
> > 
> > > -int dm_flush_maps (int retries)
> > > +int dm_flush_maps (int need_suspend, int retries)
> > >  {
> > >  	int r = 1;
> > >  	struct dm_task *dmt;
> > > @@ -1014,7 +1014,10 @@ int dm_flush_maps (int retries)
> > >  
> > >  	r = 0;
> > >  	do {
> > > -		r |= dm_suspend_and_flush_map(names->name, retries);
> > > +		if (need_suspend)
> > > +			r |= dm_suspend_and_flush_map(names->name,
> > > retries);
> > > +		else
> > > +			r |= dm_flush_map(names->name);
> > 
> > This is fine, but considering the previous discussion, I'd prefer
> > to
> > get rid of need_suspend and dm_suspend_and_flush_map() entirely. It
> > would simplify the _dm_flush_map code path significantly.
> > 
> > As we determined that we use the suspend/resume only in multipath
> > anyway, we could add it there in the "non-delegated" code path.
> 
> I'm confused. dm_flush_maps() is also called in the non-delegated
> code
> path, where it uses the dm_suspend_and_flush_map(). Are you proposing
> an alternative version of dm_flush_maps() for multipath?

No, just a different error handling in multipath. Instead of calling
just calling dm_flush_maps() again from multipath with need_suspend=1,
we could suspend / resume directly in the error path, and then call
dm_flush_map again. Which would allow us to get rid of need_suspend, as
no callers would set it any more.

IOW, move the handling of this multipath-specific error situation out
of libmultipath, into the multipath-specific code.

Just an idea, I don't insist on it.

Martin

-- 
Dr. Martin Wilck <mwilck at suse.com>, Tel. +49 (0)911 74053 2107
SUSE  Software Solutions Germany GmbH
HRB 36809, AG Nürnberg GF: Felix
Imendörffer






More information about the dm-devel mailing list