All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: lixiaokeng <lixiaokeng@huawei.com>,
	Christophe Varoqui <christophe.varoqui@opensvc.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	dm-devel mailing list <dm-devel@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	"liuzhiqiang \(I\)" <liuzhiqiang26@huawei.com>
Subject: Re: [dm-devel] [PATCH] multipathd: fix missing persistent reseravtion for active path
Date: Fri, 10 Sep 2021 18:17:50 +0200	[thread overview]
Message-ID: <421bf852fdf9298bb5c0fd41e53adc1bff4e4050.camel@suse.com> (raw)
In-Reply-To: <298ae89f-6d47-546d-a87e-42e6563a17f2@huawei.com>

Hello lixiaokeng,

thanks for your patch.

On Fri, 2021-09-10 at 20:31 +0800, lixiaokeng wrote:
> There are two paths(sucu as sda and adb) for one LUN. The two
> paths log in, but before the two uevents have been processed
> (for example there are many uevent), users use multipathd add
> path /dev/sda to cause mpatha and use mpathpersist -o -I to
> register prkey for mpatha. The add map uevent is after add path
> uevent, the the uevent(add sdb) will delay and missing persistent
> reseravtion check.
> 
> Here, we add persistent reseravtion check in ev_add_map if
> mpp->wait_for_udev > 1.
> 
> Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
> ---
>  multipathd/main.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/multipathd/main.c b/multipathd/main.c
> index 3aff241d..ef456c34 100644
> --- a/multipathd/main.c
> +++ b/multipathd/main.c
> @@ -706,6 +706,8 @@ ev_add_map (char * dev, const char * alias,
> struct vectors * vecs)
>         struct multipath * mpp;
>         int delayed_reconfig, reassign_maps;
>         struct config *conf;
> +       struct path *pp;
> +       int i;
> 
>         if (dm_is_mpath(alias) != 1) {
>                 condlog(4, "%s: not a multipath map", alias);
> @@ -721,6 +723,13 @@ ev_add_map (char * dev, const char * alias,
> struct vectors * vecs)
>                         if (update_map(mpp, vecs, 0))
>                                 /* setup multipathd removed the map
> */
>                                 return 1;

Should you make this conditional on mpp->prflag, perhaps?
After all, sda has already been added, sp prflag should should be set
if that was successful.

I think this should rather be added to update_map(). Ben?


> +
> +                       vector_foreach_slot(mpp->paths, pp, i) {
> +                               if ((pp->state == PATH_UP)  || (pp-
> >state == PATH_GHOST)) {
> +                                       /* persistent reseravtion
> check*/

Typo above.

> +                                       mpath_pr_event_handle(pp);
> +                               }
> +                       }
>                 }
>                 conf = get_multipath_config();
>                 delayed_reconfig = conf->delayed_reconfig;


Thanks,
Martin


--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2021-09-10 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 12:31 [dm-devel] [PATCH] multipathd: fix missing persistent reseravtion for active path lixiaokeng
2021-09-10 16:17 ` Martin Wilck [this message]
2021-09-11  3:28   ` lixiaokeng
2021-09-11 19:13     ` Martin Wilck
2021-09-13 15:23       ` Benjamin Marzinski

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=421bf852fdf9298bb5c0fd41e53adc1bff4e4050.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.