[dm-devel] [PATCH 2/3] multipathd: ev_add_path: fail if add_map_with_path() fails
Benjamin Marzinski
bmarzins at redhat.com
Wed Feb 3 19:30:52 UTC 2021
On Tue, Feb 02, 2021 at 10:41:30PM +0100, mwilck at suse.com wrote:
> From: Martin Wilck <mwilck at suse.com>
>
> If start_waiter was set before and the "rescan" label was used,
> we may try to set up an empty/invalid map.
> Always fail if add_map_with_path() isn't successful.
>
> Signed-off-by: Martin Wilck <mwilck at suse.com>
This patch looks fine, but I don't think that there was any risk before.
I don't see how you could loop back to rescan with mpp == NULL, which
is what would need to happen before you could ever run this code.
At any rate
Reviewed-by: Benjamin Marzinski <bmarzin at redhat.com>
> ---
> multipathd/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 43d7768..425492a 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -1028,7 +1028,7 @@ rescan:
> */
> start_waiter = 1;
> }
> - if (!start_waiter)
> + else
> goto fail; /* leave path added to pathvec */
> }
>
> --
> 2.29.2
More information about the dm-devel
mailing list