<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><span></span>Hi:</div>
<div><span style="line-height:19px">When storage network is unstable, </span><span style="font-size:16pt; background-color:window; line-height:19px">it may trigger the panic in </span><span style="font-size:16pt; line-height:1.5; background-color:window">ocfs2_start_trans.</span></div>
<div><span style="font-size:16pt; line-height:1.5; background-color:window"> </span><span style="font-size:16pt; line-height:1.5; background-color:window">ocfs2_start_trans -> </span><span style="font-size:16pt; line-height:1.5">ocfs2_abort</span><span style="font-size:16pt; line-height:1.5; background-color:window"> ->panic,</span><span style="background-color:window; font-size:16pt; line-height:1.5">whether
there is a better way to solve this problem? </span></div>
<div>Just mark as a mistake<span style="line-height:19px"> instead of </span>ocfs2_abort<span style="line-height:19px">. </span></div>
<div><span style="line-height:1.5">Finally, any feedback about this process </span><span style="line-height:1.5">(positive or negative) would be greatly appreciated.</span></div>
<div><span style="line-height:1.5"><br>
</span></div>
<div><span class="op_dict3_highlight">Callback as</span> <span class="op_dict3_highlight">
follows:</span></div>
<div><span class="op_dict3_highlight"><span style="">Jul 8 15:34:16 cvk99 kernel: [72056.516720] (o2hb-5CED29F793,5052,1):o2hb_bio_end_io:381 ERROR: IO Error -5<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516723] (o2hb-5CED29F793,5052,1):o2hb_do_disk_heartbeat:993 ERROR: status = -5</span></span></div>
<div><span style="">Jul 8 15:34:16 cvk99 kernel: [72056.516730] (pool,7938,6):ocfs2_commit_trans:393 ERROR: status = -5<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516733] (pool,7938,6):ocfs2_write_begin_inline:1515 ERROR: status = -30<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516735] (pool,7938,6):ocfs2_try_to_write_inline_data:1594 ERROR: status = -30<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516738] (pool,7938,6):ocfs2_write_begin_nolock:1721 ERROR: status = -30<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516741] (pool,7938,6):ocfs2_write_begin:1937 ERROR: status = -30<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516772] (pool,8052,0):ocfs2_start_trans:368 ERROR: status = -30<br>
Jul 8 15:34:16 cvk99 kernel: [72056.516776] OCFS2: abort (device sdb): ocfs2_start_trans: Detected aborted journal</span></div>
<div><span style=""><br>
</span></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> </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>发件人:</b> <a href="mailto:zhang.guanghui@h3c.com">zhangguanghui 10102</a></div>
<div><b>发送时间:</b> 2015-07-06 10:29</div>
<div><b>收件人:</b> <a href="mailto:joseph.qi@huawei.com">Joseph Qi</a>; <a href="mailto:akpm@linux-foundation.org">
Andrew Morton</a></div>
<div><b>抄送:</b> <a href="mailto:mfasheh@suse.com">Mark Fasheh</a>; <a href="mailto:jlbec@evilplan.org">
Joel Becker</a>; <a href="mailto:ocfs2-devel@oss.oracle.com">ocfs2-devel@oss.oracle.com</a></div>
<div><b>主题:</b> Re: [PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access</div>
</div>
</div>
<div>
<div class="FoxDiv20150710114538059954">
<div><br>
</div>
<div><font size="3" style="background-color:window">This patch is currently verified and working well for two weeks. </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"> </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 </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> </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> <a href="mailto:joseph.qi@huawei.com">Joseph Qi</a></div>
<div><b>Date:</b> 2015-07-06 10:05</div>
<div><b>To:</b> <a href="mailto:akpm@linux-foundation.org">Andrew Morton</a></div>
<div><b>CC:</b> <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> [PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access</div>
</div>
</div>
<div>
<div class="FoxDiv20150706100748937034">
<p style="margin-top:0px; margin-bottom:0px"><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 <zhang.guanghui@h3c.com><br>
Signed-off-by: Joseph Qi <joseph.qi@huawei.com><br>
---<br>
fs/ocfs2/journal.c | 18 +++++++++++++++++-<br>
1 file changed, 17 insertions(+), 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>
+++ b/fs/ocfs2/journal.c<br>
@@ -670,7 +670,23 @@ static int __ocfs2_journal_access(handle_t *handle,<br>
mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n");<br>
mlog(ML_ERROR, "b_blocknr=%llu\n",<br>
(unsigned long long)bh->b_blocknr);<br>
- BUG();<br>
+<br>
+ lock_buffer(bh);<br>
+ /*<br>
+ * A previous attempt to write this buffer head failed.<br>
+ * Nothing we can do but to retry the write and hope for<br>
+ * the best.<br>
+ */<br>
+ if (buffer_write_io_error(bh) && !buffer_uptodate(bh)) {<br>
+ clear_buffer_write_io_error(bh);<br>
+ set_buffer_uptodate(bh);<br>
+ }<br>
+<br>
+ if (!buffer_uptodate(bh)) {<br>
+ unlock_buffer(bh);<br>
+ return -EIO;<br>
+ }<br>
+ unlock_buffer(bh);<br>
}<br>
<br>
/* Set the current transaction information on the ci so<br>
--<br>
1.8.4.3<br>
<br>
<br>
</font></p>
</div>
</div>
</blockquote>
</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:"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>
</body>
</html>