<div dir="ltr">Right, done.<div>The leftover from your previous v3 patchset is merged too.</div><div>Thanks,</div><div>Christophe.</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Jul 2, 2018 at 11:33 AM Martin Wilck <<a href="mailto:mwilck@suse.com">mwilck@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Christophe,<br>
<br>
without this patch, current upstream multipath _crashes_ on path<br>
removal. Please apply it. If reviewers disagree with this fix, I can<br>
post updates later.<br>
<br>
Martin<br>
<br>
On Mon, 2018-06-25 at 17:10 +0200, Martin Wilck wrote:<br>
> In my previous patch f0462f0c8338, I overlooked that during path<br>
> removal,<br>
> the path that mpp->hwe references may be removed and and thus mpp-<br>
> >hwe<br>
> may become stale. Fix it.<br>
> <br>
> Fixes: f0462f0c8338 "libmultipath: use vector for for pp->hwe and mp-<br>
> >hwe"<br>
> Signed-off-by: Martin Wilck <<a href="mailto:mwilck@suse.com" target="_blank">mwilck@suse.com</a>><br>
> ---<br>
>  multipathd/main.c | 11 +++++++++++<br>
>  1 file changed, 11 insertions(+)<br>
> <br>
> diff --git a/multipathd/main.c b/multipathd/main.c<br>
> index 72f06b56..cc493c18 100644<br>
> --- a/multipathd/main.c<br>
> +++ b/multipathd/main.c<br>
> @@ -1076,6 +1076,14 @@ ev_remove_path (struct path *pp, struct<br>
> vectors * vecs, int need_do_map)<br>
>                               mpp->alias);<br>
>                       goto fail;<br>
>               }<br>
> +<br>
> +             /*<br>
> +              * Make sure mpp->hwe doesn't point to freed memory<br>
> +              * We call extract_hwe_from_path() below to restore<br>
> mpp->hwe<br>
> +              */<br>
> +             if (mpp->hwe == pp->hwe)<br>
> +                     mpp->hwe = NULL;<br>
> +<br>
>               if ((i = find_slot(mpp->paths, (void *)pp)) != -1)<br>
>                       vector_del_slot(mpp->paths, i);<br>
>  <br>
> @@ -1109,6 +1117,9 @@ ev_remove_path (struct path *pp, struct vectors<br>
> * vecs, int need_do_map)<br>
>                        */<br>
>               }<br>
>  <br>
> +             if (mpp->hwe == NULL)<br>
> +                     extract_hwe_from_path(mpp);<br>
> +<br>
>               if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {<br>
>                       condlog(0, "%s: failed to setup map for"<br>
>                               " removal of path %s", mpp->alias,<br>
> pp->dev);<br>
<br>
-- <br>
Dr. Martin Wilck <<a href="mailto:mwilck@suse.com" target="_blank">mwilck@suse.com</a>>, Tel. +49 (0)911 74053 2107<br>
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton<br>
HRB 21284 (AG Nürnberg)<br>
<br>
</blockquote></div>