[dm-devel] [PATCH v2 6/6] libmultipath: drop unnecessary parameter from remove_map()

Martin Wilck martin.wilck at suse.com
Fri Sep 3 15:22:45 UTC 2021


On Fri, 2021-09-03 at 11:28 +0200, Martin Wilck wrote:
> On Thu, 2021-09-02 at 16:57 -0500, Benjamin Marzinski wrote:
> > When remove_map() is called, if the multipath device is in a mpvec,
> > it
> > must be removed from it, because the device will be freed. Now that
> > the
> > mpvec is passed as a separate parameter to remove_map(), the
> > purge_vec
> > parameter is redundant.  It was only used by coalesce_paths(),
> > since
> > the
> > multipath device isn't on any vector when remove_map() is called
> > there.
> > Instead, remove_map() can just be called with a NULL mpvec, when
> > there
> > is no mpvec to remove the device from.
> > 
> > remove_map_by_alias() also has a redundant purge_vec parameter. 
> > Since
> > it only removes a map if it finds in on vec->mpvec, calling it with
> > KEEP_VEC would be a bug, since it would leave a pointer to the
> > freed
> > device in the vector.
> > 
> > Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
> 
> Good catch. But we need to adapt libmultipath.version. I'll send a
> fix
> to be added on top.
> 
> Reviewed-by: Martin Wilck <mwilck at suse.com>

This breaks the directio test, too. We need a test patch on top.
I'm going to post it.

Martin





More information about the dm-devel mailing list