<div dir="ltr"><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">When I added a new volume to the drbd resource(I tested in drbd 9.0.*, 9.1.* versions), I found there i</span><span style="font-family:宋体;font-size:11pt">s a very high probability</span><span style="font-family:宋体;font-size:11pt"> that the resource will block in a consistent state and never change </span><span style="font-family:宋体;font-size:11pt">automatically</span><span style="font-family:宋体;font-size:11pt">. </span><span style="font-family:宋体;font-size:11pt">I analyzed the difference </span><span style="font-family:宋体;font-size:11pt">of logs </span><span style="font-family:宋体;font-size:11pt">between success and unsucces</span><span style="font-family:宋体;font-size:11pt">s</span><span style="font-family:宋体;font-size:11pt"> dynamically adding volumes</span><span style="font-family:宋体;font-size:11pt">. I find </span><span style="font-family:宋体;font-size:11pt">The failure is </span><span style="font-family:宋体;font-size:11pt">due to not obtaining </span><span style="font-family:宋体;font-size:11pt">the </span><span style="font-family:宋体;font-size:11pt">correct </span><span style="font-family:宋体;font-size:11pt">UUID</span><span style="font-family:宋体;font-size:11pt"> yet when calling the may_return_to_up_to_date function, so I made a patch like below and the problem is fixed. </span><span style="font-family:宋体;font-size:11pt">B</span><span style="font-family:宋体;font-size:11pt">ut because drbd state is too complicated, </span><span style="font-family:宋体;font-size:11pt">I&#39;m not sure if this </span><span style="font-family:宋体;font-size:11pt">will </span><span style="font-family:宋体;font-size:11pt">introduce other problems</span><span style="font-family:宋体;font-size:11pt">.</span><span style="font-family:宋体;font-size:11pt;text-align:justify">Hoping to get some guidance and </span><span style="font-family:宋体;font-size:11pt">Hopefully this will go some way toward actually fixing the problem</span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">---</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> drbd-9.1.2/drbd/drbd_state.c | 27 +++++++++++++++++++--------</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> 1 file changed, 19 insertions(+), 8 deletions(-)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">diff --git a/drbd-9.1.2/drbd/drbd_state.c b/drbd-9.1.2/drbd/drbd_state.c</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">index c45284b..0cc75df 100644</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">--- a/drbd-9.1.2/drbd/drbd_state.c</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+++ b/drbd-9.1.2/drbd/drbd_state.c</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -83,7 +83,8 @@ static void sanitize_state(struct drbd_resource *resource);</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">    different UUID. This function should be used if the device was D_UP_TO_DATE</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">    before.</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">  */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-static bool may_return_to_up_to_date(struct drbd_device *device, enum which_state which)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+static bool may_return_to_up_to_date(struct drbd_device *device, enum which_state which,</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">bool from_md)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">struct drbd_peer_device *peer_device;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">bool rv = true;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -93,6 +94,15 @@ static bool may_return_to_up_to_date(struct drbd_device *device, enum which_stat</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (peer_device-&gt;disk_state[which] == D_DISKLESS &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    peer_device-&gt;connection-&gt;peer_role[which] == R_PRIMARY &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    peer_device-&gt;current_uuid != drbd_current_uuid(device)) {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">/* here ignore peer_device-&gt;current_uuid == 0, hope reverify when</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt"> * peer_device-&gt;current_uuid is set</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt"> * */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (peer_device-&gt;current_uuid == 0 &amp;&amp; from_md) {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">continue;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">}</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">rv = false;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">break;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">}</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -108,12 +118,13 @@ static bool may_return_to_up_to_date(struct drbd_device *device, enum which_stat</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">  * When fencing is enabled, it may only transition from D_CONSISTENT to D_UP_TO_DATE</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">  * when ether all peers are connected, or outdated.</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">  */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-static bool may_be_up_to_date(struct drbd_device *device, enum which_state which) __must_hold(local)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+static bool may_be_up_to_date(struct drbd_device *device, enum which_state which,</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">bool from_md) __must_hold(local)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">bool all_peers_outdated = true;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">int node_id;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (!may_return_to_up_to_date(device, which))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (!may_return_to_up_to_date(device, which, from_md))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">return false;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">rcu_read_lock();</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -216,7 +227,7 @@ enum drbd_disk_state disk_state_from_md(struct drbd_device *device) __must_hold(</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">else if (!drbd_md_test_flag(device-&gt;ldev, MDF_WAS_UP_TO_DATE))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state = D_OUTDATED;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">else</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state = may_be_up_to_date(device, NOW) ? D_UP_TO_DATE : D_CONSISTENT;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state = may_be_up_to_date(device, NOW, true) ? D_UP_TO_DATE : D_CONSISTENT;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">return disk_state;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> }</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -2103,12 +2114,12 @@ static void sanitize_state(struct drbd_resource *resource)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">/* The attempted resync made us D_OUTDATED, roll that back in case */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (repl_state[OLD] == L_WF_BITMAP_T &amp;&amp; repl_state[NEW] == L_OFF &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    disk_state[NEW] == D_OUTDATED &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    stable_up_to_date_neighbor(device) &amp;&amp; may_be_up_to_date(device, NEW))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">stable_up_to_date_neighbor(device) &amp;&amp; may_be_up_to_date(device, NEW, false))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state[NEW] = D_UP_TO_DATE;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">/* clause intentional here, the D_CONSISTENT form above might trigger this */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (repl_state[OLD] &lt; L_ESTABLISHED &amp;&amp; repl_state[NEW] &gt;= L_ESTABLISHED &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    disk_state[NEW] == D_CONSISTENT &amp;&amp; may_be_up_to_date(device, NEW))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state[NEW] == D_CONSISTENT &amp;&amp; may_be_up_to_date(device, NEW, false))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">disk_state[NEW] = D_UP_TO_DATE;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">/* Follow a neighbor that goes from D_CONSISTENT TO D_UP_TO_DATE */</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -3699,7 +3710,7 @@ static int w_after_state_change(struct drbd_work *w, int unused)</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">send_new_state_to_all_peer_devices(state_change, n_device);</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (disk_state[OLD] == D_UP_TO_DATE &amp;&amp; disk_state[NEW] == D_CONSISTENT &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    may_return_to_up_to_date(device, NOW))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">may_return_to_up_to_date(device, NOW, false))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">try_become_up_to_date = true;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (test_bit(TRY_TO_GET_RESYNC, &amp;device-&gt;flags)) {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">@@ -4875,7 +4886,7 @@ static bool do_change_from_consistent(struct change_context *context, enum chang</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">idr_for_each_entry(&amp;resource-&gt;devices, device, vnr) {</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">if (device-&gt;disk_state[NOW] == D_CONSISTENT &amp;&amp;</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">    may_return_to_up_to_date(device, NOW))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">+</span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">may_return_to_up_to_date(device, NOW, false))</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">__change_disk_state(device, D_UP_TO_DATE);</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">}</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt"> </span><span style="font-family:宋体;font-size:11pt">        </span><span style="font-family:宋体;font-size:11pt">}</span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">-- </span><span style="font-family:宋体;font-size:11pt"></span></p><p class="MsoNormal" style="margin:0pt 0pt 0.0001pt;font-family:Calibri;font-size:10.5pt"><span style="font-family:宋体;font-size:11pt">1.8.3.1</span><span style="font-family:宋体;color:rgb(74,144,226);letter-spacing:0pt;font-size:10.5pt;background:rgb(247,248,250)"></span></p></div>