Linux Device Mapper development
 help / color / mirror / Atom feed
From: lixiaokeng <lixiaokeng@huawei.com>
To: Benjamin Marzinski <bmarzins@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	dm-devel mailing list <dm-devel@redhat.com>,
	Martin Wilck <mwilck@suse.com>,
	"liuzhiqiang \(I\)" <liuzhiqiang26@huawei.com>
Subject: Re: [dm-devel] [PATCH 5/5] add prflag to path
Date: Fri, 19 Nov 2021 16:41:14 +0800	[thread overview]
Message-ID: <7d53681e-e828-d789-55d1-bc36b60e69e1@huawei.com> (raw)
In-Reply-To: <20211118165727.GH19591@octiron.msp.redhat.com>



On 2021/11/19 0:57, Benjamin Marzinski wrote:
> On Tue, Nov 16, 2021 at 10:01:15PM +0800, lixiaokeng wrote:
>> The update_map will frequently be called and there will be
>> unnecessary checks of reseravtion. We add prflag to path
>> to avoid this.
>>
>> The pp->state changes from others to up or ghost, the
>> mpath_pr_event_handle should be called. The
>> mpath_pr_event_handle in ev_add_path may not be called,
>> so set pp->prkey PRKEY_NO when path is removed.
> 
> This patch kind of confuses me.  You only check pp->prkey before calling
> mpath_pr_event_handle() in update_map(). I get from your commit message
> that you are doing this to keep from frequent, unnecessary calls. But
> isn't update_map() only called when a multipath device is first created,
> or when multipathd stops waiting for something that it noticed during
> device creation? I don't see how this can be frequently called on a
> multipath device. What am I missing?
> 
> -Ben
> 

Discussed in the previous patch (multipathd: fix missing persistent
reseravtion for active path) as follows:

On Mon, 2021-09-13 at 10:32 -0500, Benjamin Marzinski wrote:
> On Mon, Sep 13, 2021 at 09:01:11AM +0200, Martin Wilck wrote:
>> Hello lixiaokeng,
>>
>> On Mon, 2021-09-13 at 10:43 +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 update_map() which
>>> is called ev_add_map().
>>>
>>> Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
>>
>> Thank you, this looks ok to me. Have you tested it?
>>
>> I'll wait for Ben's opinion nonetheless, because he's more
>> exprerienced
>> with this part of the code than myself.
>>
>> This said, I would like to have multipathd record which paths have
>> already registered the key, to avoid doing that repeatedly.
>>
> Other than adding this, the patch looks fine.

There may be some mistakes. I mistakenly thought update_map would
be called multiple times

In check_path, mpath_pr_event_handle is only called pp->state
changes from others to up. Some prkey changes may happen when
pp->state is down, so mpath_pr_event_handle should be called
even pp->prkey is PRKEY_OK.

As Ben said, update_map will not be called repetitively. I think
this patch should be removed.

Thank Ben and Martin.

Regards,
Lixiaokeng

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


      reply	other threads:[~2021-11-19  8:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16 13:58 [dm-devel] [PATCH 0/5] multipath-tools series: some codeclean and add prflag to path lixiaokeng
2021-11-16 13:59 ` [dm-devel] [PATCH 1/5] Fix potential null pointer dereference lixiaokeng
2021-11-17 18:05   ` Benjamin Marzinski
2021-11-18  2:04     ` lixiaokeng
2021-11-16 13:59 ` [dm-devel] [PATCH 2/5] remove unnecessary memset lixiaokeng
2021-11-18  0:10   ` Benjamin Marzinski
2021-11-16 14:00 ` [dm-devel] [PATCH 3/5] remove unnecessary free lixiaokeng
2021-11-18  0:14   ` Benjamin Marzinski
2021-11-16 14:00 ` [dm-devel] [PATCH 4/5] Match FREE and MALLOC/STRDUP/REALLOC lixiaokeng
2021-11-18  0:47   ` Benjamin Marzinski
2021-11-18  2:46     ` lixiaokeng
2021-11-18 15:35       ` Martin Wilck
2021-11-18 15:31     ` Martin Wilck
2021-11-16 14:01 ` [dm-devel] [PATCH 5/5] add prflag to path lixiaokeng
2021-11-18 15:36   ` Martin Wilck
2021-11-18 16:57   ` Benjamin Marzinski
2021-11-19  8:41     ` lixiaokeng [this message]

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=7d53681e-e828-d789-55d1-bc36b60e69e1@huawei.com \
    --to=lixiaokeng@huawei.com \
    --cc=bmarzins@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=mwilck@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox