All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: lixiaokeng <lixiaokeng@huawei.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>,
	dm-devel@redhat.com
Cc: linfeilong@huawei.com, liuzhiqiang26@huawei.com
Subject: Re: [PATCH 4/5] multipathd: disable queueing for recreated map in uev_remove_map
Date: Wed, 19 Aug 2020 11:27:33 +0200	[thread overview]
Message-ID: <5ca4ef4256899586729d3ac21546671b6124937c.camel@suse.com> (raw)
In-Reply-To: <178ce8f8-cf74-bb32-1e5c-41674f493a24@huawei.com>

On Tue, 2020-08-18 at 21:09 +0800, lixiaokeng wrote:
> There may be a race window here:
> 1. all paths gone, causing map flushed both from multipathd and
> kernel
> 2. paths regenerated, causing multipathd creating the map again.
> 
> 1 will generate a remove uevent which can be handled after 2, so we
> can
> disable queueing for the map created by 2 here temporarily and let
> the
> change uevent (generated by 2) calling uev_add_map->setup_multipath
> to set queueing again. This can prevent the deadlock in this race
> window.
> 
> The possible deadlock is: all udevd workers hangs in devices because
> of
> queue_if_no_path, so no udevd workers can handle new event and since
> multipathd will remove the map, the checkerloop cannot check this
> map's
> retry tick timeout and cancel the io hang which makes the udevd
> worker
> hang forever. multipathd cannot receive any uevent from udevd because
> all udevd workers hang there so the map cannot be recreated again
> which
> makes a deadlock.
> 
> Signed-off-by: Lixiaokeng@huawei.com

As noted in my other reply, I don't fully understand how this deadlock
actually came to pass. But disabling queuing on a map which can't be
in use at the given point in time can't do no harm. So:

Reviewed-by: Martin Wilck <mwilck@suse.com>

> ---
>  multipathd/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index baa18183..d7e20a10 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -798,6 +798,7 @@ uev_remove_map (struct uevent * uev, struct
> vectors * vecs)
>  		goto out;
>  	}
> 
> +	dm_queue_if_no_path(alias, 0);
>  	remove_map_and_stop_waiter(mpp, vecs);
>  out:
>  	lock_cleanup_pop(vecs->lock);

  parent reply	other threads:[~2020-08-19  9:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 12:59 [PATCH 0/5] multipath-tools series: coredump and memory leak bugfix lixiaokeng
2020-08-18 13:02 ` [PATCH 1/5 v4] libmultipath fix a memory leak in set_ble_device lixiaokeng
2020-08-18 15:57   ` Martin Wilck
2020-08-18 13:06 ` [PATCH 2/5] libmultipath fix NULL dereference in select_action lixiaokeng
2020-08-18 16:28   ` Martin Wilck
2020-08-21  4:41     ` lixiaokeng
2020-08-18 13:08 ` [PATCH 3/5] multipathd: add reclear_pp_from_mpp in ev_remove_path lixiaokeng
2020-08-18 16:36   ` Martin Wilck
2020-08-20 14:51     ` lixiaokeng
2020-08-20 15:22       ` Martin Wilck
2020-08-24 13:07         ` lixiaokeng
2020-08-18 13:09 ` [PATCH 4/5] multipathd: disable queueing for recreated map in uev_remove_map lixiaokeng
2020-08-18 19:23   ` Martin Wilck
2020-08-19  8:48     ` lixiaokeng
2020-08-19  9:27   ` Martin Wilck [this message]
2020-08-18 13:11 ` [PATCH 5/5] libmultipath fix daemon memory leak in disassemble_map lixiaokeng
2020-08-19  1:42   ` lixiaokeng
2020-08-19  1:50 ` lixiaokeng
2020-08-19  8:26   ` Martin Wilck
2020-08-19  8:45     ` lixiaokeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ca4ef4256899586729d3ac21546671b6124937c.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=lixiaokeng@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.