[dm-devel] [PATCH] multipathd: fix mpp->hwe handling on path removal

Christophe Varoqui christophe.varoqui at opensvc.com
Mon Jul 2 10:05:52 UTC 2018


Right, done.
The leftover from your previous v3 patchset is merged too.
Thanks,
Christophe.

On Mon, Jul 2, 2018 at 11:33 AM Martin Wilck <mwilck at suse.com> wrote:

> Christophe,
>
> without this patch, current upstream multipath _crashes_ on path
> removal. Please apply it. If reviewers disagree with this fix, I can
> post updates later.
>
> Martin
>
> On Mon, 2018-06-25 at 17:10 +0200, Martin Wilck wrote:
> > In my previous patch f0462f0c8338, I overlooked that during path
> > removal,
> > the path that mpp->hwe references may be removed and and thus mpp-
> > >hwe
> > may become stale. Fix it.
> >
> > Fixes: f0462f0c8338 "libmultipath: use vector for for pp->hwe and mp-
> > >hwe"
> > Signed-off-by: Martin Wilck <mwilck at suse.com>
> > ---
> >  multipathd/main.c | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/multipathd/main.c b/multipathd/main.c
> > index 72f06b56..cc493c18 100644
> > --- a/multipathd/main.c
> > +++ b/multipathd/main.c
> > @@ -1076,6 +1076,14 @@ ev_remove_path (struct path *pp, struct
> > vectors * vecs, int need_do_map)
> >                               mpp->alias);
> >                       goto fail;
> >               }
> > +
> > +             /*
> > +              * Make sure mpp->hwe doesn't point to freed memory
> > +              * We call extract_hwe_from_path() below to restore
> > mpp->hwe
> > +              */
> > +             if (mpp->hwe == pp->hwe)
> > +                     mpp->hwe = NULL;
> > +
> >               if ((i = find_slot(mpp->paths, (void *)pp)) != -1)
> >                       vector_del_slot(mpp->paths, i);
> >
> > @@ -1109,6 +1117,9 @@ ev_remove_path (struct path *pp, struct vectors
> > * vecs, int need_do_map)
> >                        */
> >               }
> >
> > +             if (mpp->hwe == NULL)
> > +                     extract_hwe_from_path(mpp);
> > +
> >               if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {
> >                       condlog(0, "%s: failed to setup map for"
> >                               " removal of path %s", mpp->alias,
> > pp->dev);
>
> --
> 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)
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20180702/8cfc6d0f/attachment.htm>


More information about the dm-devel mailing list