<div class="zcontentRow"> <p>Hello <span style="line-height: 21px;">Martin,</span><br></p><p><span style="line-height: 21px;"><br></span></p><p><span style="line-height: 21px;">This exmaple shows why we need <span style="line-height: 21px;"> to stop merging,</span></span></p><p><span style="line-height: 21px;"><span style="line-height: 21px;">Yes, <span style="line-height: 21px;"> It's fine since we have "<span style="line-height: 21px;">stop merging</span>" in current code.</span></span></span></p><p><span style="line-height: 21px;"><span style="line-height: 21px;"><span style="line-height: 21px;"><br></span></span></span></p><p><span style="line-height: 21px;">Regards</span><br style="white-space: normal;">Tang</p><p><br></p><p><br></p><p><br></p><div><div class="zhistoryRow" style="display:block"><div class="zhistoryDes" style="width: 100%; height: 28px; line-height: 28px; background-color: #E0E5E9; color: #1388FF; text-align: center;" language-data="HistoryOrgTxt">原始邮件</div><div id="zwriteHistoryContainer"><div class="control-group zhistoryPanel"><div class="zhistoryHeader" style="padding: 8px; background-color: #F5F6F8;"><div><strong language-data="HistorySenderTxt">发件人:</strong><span class="zreadUserName"> <mwilck@suse.com>;</span></div><div><strong language-data="HistoryTOTxt">收件人:</strong><span class="zreadUserName" style="display: inline-block;"> <dm-devel@redhat.com>;</span></div><div><strong language-data="HistoryDateTxt">日 期 :</strong><span class="">2017年02月20日 19:24</span></div><div><strong language-data="HistorySubjectTxt">主 题 :</strong><span class="zreadTitle"><strong>Re: [dm-devel] 答复: Re:  [PATCH] multipath-tools: improve processing efficiency for addition and deletion of multipath devices</strong></span></div></div><p class="zhistoryContent"><br></p><div>Hello Tang,<br><br>> In the second case, we know all events in the sequence have the<br>> same<br>> > WWID; in this case I think it would be safe to filter away "remove"<br>> > events by subsequent "add" events, ending up with "add path1| add<br>> > path2| remove path3". But I may be overlooking something here.<br>> <br>> > The dangerous thing if you have simultaneous remove and add events<br>> for<br>> > the same LUN is that processing the "add" events is likely to fail<br>> in<br>> > domap(). If you get "add path1 | remove path2", once you process<br>> "add<br>> > path1", "path2" may not exist in the kernel any more, and "domap"<br>> will<br>> > fail if you try to set up both; you may end up removing the map<br>> > completely. IMHO the only safe way to process events in this<br>> situation<br>> > is to merge the events into a single domap() call.<br>> <br>> "case 2: remove path1 |add path1 |remove path2 |add path2 |remove<br>> path3"<br>> Since the mergering is starting from the latest to the eariest<br>> uevent,  so the<br>> uevent "remove path3" try to merger other uevents, if we do not stop<br>> mergering, <br>> uevent "remove path3" would merge  uevent "remove path2" and uevent <br>> "remove path1". Uevent "add  path2" would merge "add  path1". <br>> The result is that we get two merged uevents:<br>> 1) add path2, path1<br>> 2) remove path3, path2, path1 <br><br>> Then we process the merged uevents from the earlier to later, We try<br>> to ”add <br>> path2 path1“, and we would create or reload a map device with path1<br>> and path2. <br>> Next we process ” remove path3, path2, path1“, so path1, path2 and<br>> path3 are <br>> all removed from the map device, this is wrong,  the correct result<br>> is that the path1<br>> and path2 should be still in the map device.<br><br>I don't understand that. This would mean that you'd re-order "remove<br>path1 | add path1" into "add path1| remove path1", and the same for<br>path2. That may obviously never happen. Your "stop merging" logic<br>forbids it, and that's fine for me for now.<br><br>Regards<br>Martin<br><br>-- <br>Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107<br>SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton<br>HRB 21284 (AG Nürnberg)<br><br>--<br>dm-devel mailing list<br>dm-devel@redhat.com<br>https://www.redhat.com/mailman/listinfo/dm-devel</div><p><br></p></div></div></div></div><p><br></p> </div>