Linux Device Mapper development
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: dm-devel@redhat.com
Subject: Re: 答复: Re:  [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices
Date: Mon, 20 Feb 2017 12:08:22 +0100	[thread overview]
Message-ID: <1487588902.4446.7.camel@suse.com> (raw)
In-Reply-To: <201702171124101816133@zte.com.cn>

Hello Tang,

> In the second case, we know all events in the sequence have the
> same
> > WWID; in this case I think it would be safe to filter away "remove"
> > events by subsequent "add" events, ending up with "add path1| add
> > path2| remove path3". But I may be overlooking something here.
> 
> > The dangerous thing if you have simultaneous remove and add events
> for
> > the same LUN is that processing the "add" events is likely to fail
> in
> > domap(). If you get "add path1 | remove path2", once you process
> "add
> > path1", "path2" may not exist in the kernel any more, and "domap"
> will
> > fail if you try to set up both; you may end up removing the map
> > completely. IMHO the only safe way to process events in this
> situation
> > is to merge the events into a single domap() call.
> 
> "case 2: remove path1 |add path1 |remove path2 |add path2 |remove
> path3"
> Since the mergering is starting from the latest to the eariest
> uevent,  so the
> uevent "remove path3" try to merger other uevents, if we do not stop
> mergering, 
> uevent "remove path3" would merge  uevent "remove path2" and uevent 
> "remove path1". Uevent "add  path2" would merge "add  path1". 
> The result is that we get two merged uevents:
> 1) add path2, path1
> 2) remove path3, path2, path1 

> Then we process the merged uevents from the earlier to later, We try
> to ”add 
> path2 path1“, and we would create or reload a map device with path1
> and path2. 
> Next we process ” remove path3, path2, path1“, so path1, path2 and
> path3 are 
> all removed from the map device, this is wrong,  the correct result
> is that the path1
> and path2 should be still in the map device.

I don't understand that. This would mean that you'd re-order "remove
path1 | add path1" into "add path1| remove path1", and the same for
path2. That may obviously never happen. Your "stop merging" logic
forbids it, and that's fine for me for now.

Regards
Martin

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

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

  parent reply	other threads:[~2017-02-20 11:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-17  3:24 答复: Re: [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices tang.junhui
2017-02-17  6:32 ` Benjamin Marzinski
2017-02-17 11:40 ` Martin Wilck
2017-02-20 11:08 ` Martin Wilck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-02-21  5:34 tang.junhui

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=1487588902.4446.7.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=dm-devel@redhat.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