<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body
        {line-height:1.5}
blockquote
        {margin-top:0px;
        margin-bottom:0px;
        margin-left:0.5em}
p
        {margin-top:0px;
        margin-bottom:0px}
body
        {font-size:16pt;
        font-family:微软雅黑;
        color:rgb(0,0,0);
        line-height:1.5}
-->
</style>
</head>
<body>
<div><br>
</div>
<div><font size="3" style="background-color:window">This patch is currently verified and working well for two weeks.&nbsp;</font></div>
<div><font size="3" style="background-color:window">So i</font><span style="background-color:window; font-size:medium; line-height:1.5">t is reasonable for the case.</span><span></span></div>
<div><span style="font-size:16px">&nbsp; &nbsp;&nbsp;</span></div>
<div>
<div id="gt-res-c" class="g-unit">
<div id="gt-res-p">
<div id="gt-res-data">
<div id="gt-res-wrap">
<div id="gt-res-content" class="almost_half_cell">
<div dir="ltr" style="zoom:1"><span style="font-size:16px; line-height:1.5; background-color:window">Finally, any feedback about this process&nbsp;</span><span style="font-size:16px; line-height:1.5; background-color:window">(positive or negative) would be greatly
 appreciated.</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr color="#b5c4df" size="1" align="left" style="width:210px; height:1px">
<div><span>
<div style="margin:10px; font-family:verdana; font-size:10pt">
<div>zhangguanghui</div>
</div>
</span></div>
<blockquote style="margin-top:0px; margin-bottom:0px; margin-left:0.5em">
<div>&nbsp;</div>
<div style="border:none; border-top:solid #B5C4DF 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<div style="padding-right:8px; padding-left:8px; font-size:12px; font-family:tahoma; color:#000000; background:#efefef; padding-bottom:8px; padding-top:8px">
<div><b>From:</b>&nbsp;<a href="mailto:joseph.qi@huawei.com">Joseph Qi</a></div>
<div><b>Date:</b>&nbsp;2015-07-06&nbsp;10:05</div>
<div><b>To:</b>&nbsp;<a href="mailto:akpm@linux-foundation.org">Andrew Morton</a></div>
<div><b>CC:</b>&nbsp;<a href="mailto:mfasheh@suse.com">Mark Fasheh</a>; <a href="mailto:jlbec@evilplan.org">
Joel Becker</a>; <a href="mailto:zhang.guanghui@h3c.com">zhangguanghui 10102 (CCPL)</a>;
<a href="mailto:ocfs2-devel@oss.oracle.com">ocfs2-devel@oss.oracle.com</a></div>
<div><b>Subject:</b>&nbsp;[PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access</div>
</div>
</div>
<div>
<div class="FoxDiv20150706100748937034">
<p><font size="2">When storage network is unstable, it may trigger the BUG in<br>
__ocfs2_journal_access because of buffer not uptodate. We can retry the<br>
write in this case or return error instead of BUG.<br>
<br>
Reported-by: Zhangguanghui &lt;zhang.guanghui@h3c.com&gt;<br>
Signed-off-by: Joseph Qi &lt;joseph.qi@huawei.com&gt;<br>
---<br>
&nbsp;fs/ocfs2/journal.c | 18 &#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;&#43;-<br>
&nbsp;1 file changed, 17 insertions(&#43;), 1 deletion(-)<br>
<br>
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c<br>
index f8206d1..e731374 100644<br>
--- a/fs/ocfs2/journal.c<br>
&#43;&#43;&#43; b/fs/ocfs2/journal.c<br>
@@ -670,7 &#43;670,23 @@ static int __ocfs2_journal_access(handle_t *handle,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mlog(ML_ERROR, &quot;giving me a buffer that's not uptodate!\n&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mlog(ML_ERROR, &quot;b_blocknr=%llu\n&quot;,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; (unsigned long long)bh-&gt;b_blocknr);<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BUG();<br>
&#43;<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lock_buffer(bh);<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * A previous attempt to write this buffer head failed.<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Nothing we can do but to retry the write and hope for<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * the best.<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (buffer_write_io_error(bh) &amp;&amp; !buffer_uptodate(bh)) {<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clear_buffer_write_io_error(bh);<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set_buffer_uptodate(bh);<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&#43;<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!buffer_uptodate(bh)) {<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unlock_buffer(bh);<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return -EIO;<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; unlock_buffer(bh);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Set the current transaction information on the ci so<br>
--<br>
1.8.4.3<br>
<br>
<br>
</font></p>
</div>
</div>
</blockquote>
<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:&quot;Arial&quot;,&quot;sans-serif&quot;; 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>
</body>
</html>