<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>What's the reasoning behind this patch?</div><div><br>On Jul 31, 2013, at 3:51 AM, Guozhonghua <<a href="mailto:guozhonghua@h3c.com">guozhonghua@h3c.com</a>> wrote:<br><br></div><blockquote type="cite"><div>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:SimSun}
@font-face
        {font-family:SimSun}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:SimSun}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
.MsoChpDefault
        {}
@page WordSection1
        {margin:72.0pt 90.0pt 72.0pt 90.0pt}
div.WordSection1
        {}
-->
</style>
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi, </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">I find some code may be not correct as reviewing the heart beat code and test that.</span></p>
<p class="MsoNormal"><span lang="EN-US">The heart beat writing onto disk.</span></p>
<p class="MsoNormal"><span lang="EN-US">I have another question that why not encapsulate the o2hb_wait_on_io into the function o2hb_issue_node_write, just as the function o2hb_read_slots.</span></p>
<p class="MsoNormal"><span lang="EN-US">I don’t know whether the changes is correct.</span></p>
<p class="MsoNormal"><span lang="EN-US">Requesting reviews of the changes? Thanks.
</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">diff -p -C 6 cluster-old/heartbeat.c cluster-new/heartbeat.c
</span></p>
<p class="MsoNormal"><span lang="EN-US">*** cluster-old/heartbeat.c 2013-07-31 18:18:35.625069131 +0800</span></p>
<p class="MsoNormal"><span lang="EN-US">--- cluster-new/heartbeat.c 2013-07-31 18:18:35.613069052 +0800</span></p>
<p class="MsoNormal"><span lang="EN-US">*************** static int o2hb_do_disk_heartbeat(struct</span></p>
<p class="MsoNormal"><span lang="EN-US">*** 1029,1046 ****</span></p>
<p class="MsoNormal"><span lang="EN-US"> ret = o2hb_issue_node_write(reg, &write_wc);</span></p>
<p class="MsoNormal"><span lang="EN-US"> if (ret < 0) {</span></p>
<p class="MsoNormal"><span lang="EN-US"> mlog_errno(ret);</span></p>
<p class="MsoNormal"><span lang="EN-US"> goto bail;</span></p>
<p class="MsoNormal"><span lang="EN-US"> }</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US">- i = -1;</span></p>
<p class="MsoNormal"><span lang="EN-US">- while((i = find_next_bit(configured_nodes,</span></p>
<p class="MsoNormal"><span lang="EN-US">- O2NM_MAX_NODES, i + 1)) < O2NM_MAX_NODES) {</span></p>
<p class="MsoNormal"><span lang="EN-US">- membership_change |= o2hb_check_slot(reg, &reg->hr_slots[i]);</span></p>
<p class="MsoNormal"><span lang="EN-US">- }</span></p>
<p class="MsoNormal"><span lang="EN-US">- </span></p>
<p class="MsoNormal"><span lang="EN-US"> /*</span></p>
<p class="MsoNormal"><span lang="EN-US"> * We have to be sure we've advertised ourselves on disk</span></p>
<p class="MsoNormal"><span lang="EN-US"> * before we can go to steady state. This ensures that</span></p>
<p class="MsoNormal"><span lang="EN-US"> * people we find in our steady state have seen us.</span></p>
<p class="MsoNormal"><span lang="EN-US"> */</span></p>
<p class="MsoNormal"><span lang="EN-US"> o2hb_wait_on_io(reg, &write_wc);</span></p>
<p class="MsoNormal"><span lang="EN-US">--- 1029,1040 ----</span></p>
<p class="MsoNormal"><span lang="EN-US">*************** static int o2hb_do_disk_heartbeat(struct</span></p>
<p class="MsoNormal"><span lang="EN-US">*** 1058,1069 ****</span></p>
<p class="MsoNormal"><span lang="EN-US">--- 1052,1069 ----</span></p>
<p class="MsoNormal"><span lang="EN-US"> if (own_slot_ok) {</span></p>
<p class="MsoNormal"><span lang="EN-US"> o2hb_set_quorum_device(reg);</span></p>
<p class="MsoNormal"><span lang="EN-US"> o2hb_arm_write_timeout(reg);</span></p>
<p class="MsoNormal"><span lang="EN-US"> }</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> bail:</span></p>
<p class="MsoNormal"><span lang="EN-US">+ i = -1;</span></p>
<p class="MsoNormal"><span lang="EN-US">+ while((i = find_next_bit(configured_nodes,</span></p>
<p class="MsoNormal"><span lang="EN-US">+ O2NM_MAX_NODES, i + 1)) < O2NM_MAX_NODES) {</span></p>
<p class="MsoNormal"><span lang="EN-US">+ membership_change |= o2hb_check_slot(reg, &reg->hr_slots[i]);</span></p>
<p class="MsoNormal"><span lang="EN-US">+ }</span></p>
<p class="MsoNormal"><span lang="EN-US">+ </span></p>
<p class="MsoNormal"><span lang="EN-US"> /* let the person who launched us know when things are steady */</span></p>
<p class="MsoNormal"><span lang="EN-US"> if (atomic_read(&reg->hr_steady_iterations) != 0) {</span></p>
<p class="MsoNormal"><span lang="EN-US"> if (!ret && own_slot_ok && !membership_change) {</span></p>
<p class="MsoNormal"><span lang="EN-US"> if (atomic_dec_and_test(&reg->hr_steady_iterations))</span></p>
<p class="MsoNormal"><span lang="EN-US"> wake_up(&o2hb_steady_queue);</span></p>
<p class="MsoNormal"><span lang="EN-US"> }</span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
<p class="MsoNormal"><span lang="EN-US"> </span></p>
</div>
<span style="font-size:7.5pt; font-family:华文细黑; color:gray"><span lang="EN-US">-------------------------------------------------------------------------------------------------------------------------------------<br>
</span>本邮件及其附件含有杭州华三通信技术有限公司的保密信息,仅限于发送给上面地址中列出<span lang="EN-US"><br>
</span>的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、<span lang="EN-US"><br>
</span>或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本<span lang="EN-US"><br>
</span>邮件!<span lang="EN-US"><br>
</span></span><span lang="EN-US" style="font-size:7.5pt; font-family:"Arial","sans-serif"; color:gray">This e-mail and its attachments contain confidential information from H3C, which is
<br>
intended only for the person or entity whose address is listed above. Any use of the
<br>
information contained herein in any way (including, but not limited to, total or partial
<br>
disclosure, reproduction, or dissemination) by persons other than the intended <br>
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
<br>
by phone or email immediately and delete it!</span>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Ocfs2-devel mailing list</span><br><span><a href="mailto:Ocfs2-devel@oss.oracle.com">Ocfs2-devel@oss.oracle.com</a></span><br><span><a href="https://oss.oracle.com/mailman/listinfo/ocfs2-devel">https://oss.oracle.com/mailman/listinfo/ocfs2-devel</a></span></div></blockquote></body></html>