<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<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>
<div><font size="3"><span style="line-height:19px">OCFS2 is often used in high-availaibility systems, </span></font><span style="background-color:window; font-size:medium; line-height:20px; widows:1">This patch </span><span style="background-color:window; font-size:medium; line-height:20px; widows:1">enha</span><font size="3"><span style="background-color:rgb(255,255,255)"><span style="line-height:20px; widows:1">nces</span><span style="line-height:20px; widows:1"> robustness</span><span style="line-height:19px"> for </span><span style="line-height:normal">the
filesystem.</span></span></font></div>
<div style="font-size:16px"><font size="2" style="font-size:16px"><span style="line-height:19px">but storage network is unstab</span><span style="line-height:19px">le,</span></font><span style="background-color:window; line-height:19px">it still triggers a
panic, </span><span style="background-color:window; line-height:19px">such as </span><span style="line-height:1.5; background-color:window">ocfs2_start_trans -> </span>__ocfs2_abort<span style="line-height:1.5; background-color:window"> ->panic.</span></div>
<div><font size="3"><span style="background-color:rgb(255,255,255)"><span style="line-height:19px">The '</span></span></font><span style="font-size:16px; line-height:24px">s_mount_opt'</span><font size="3"><span style="background-color:rgb(255,255,255)"><span style="line-height:19px"> should </span><span style="line-height:19px">depend
on the mount option set, If </span></span></font><span style="font-size:medium; line-height:19px">errors=continue</span><font size="3"><span style="background-color:rgb(255,255,255)"><span style="line-height:19px"> is set, </span></span></font></div>
<div><font size="3"><span style="background-color:rgb(255,255,255)"><span style="line-height:19px">mark
</span></span></font><span style="font-size:16px; line-height:24px; background-color:window">as a EIO error, change
</span><span style="font-size:16px; line-height:24px; background-color:window">OCFS2_MOUNT_ERRORS_PANIC to </span><span style="font-size:16px; line-height:1.5; background-color:window">OCFS2_MOUNT_ERRORS_CONT</span><span style="font-size:16pt; background-color:window; line-height:19px"><font size="3"> in </font></span><span style="font-size:16px; line-height:1.5">__ocfs2_abort;</span></div>
<div><font size="3"><span style="line-height:24px">it's better than forcing a panic </span><span style="line-height:24px">without </span><span style="line-height:normal">decreasing availability,</span></font><span style="font-size:medium; line-height:19px; background-color:window">errors=continue
seems be well to me.</span></div>
<div style="font-size:16px"><span style="font-size:small; line-height:19px"><br>
</span></div>
<div style="font-size:16px"><font size="2" style="font-size:16px"><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></font></div>
<div>
<pre><div style="white-space:normal; font-family:微软雅黑"><span style="font-size:12px"> Aug 11 11:32:25 cvknode73 kernel: [678904.787906] (pool,23256,12):ocfs2_start_trans:367 ERROR: status = -30</span></div><blockquote style="white-space:normal; font-family:微软雅黑"><div class="FoxDiv20150811115357296325" style="position:static!important"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825046] CPU: 12 PID: 23256 Comm: pool Tainted: GF W IO 3.13.6 #1 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825050] Hardware name: HP ProLiant BL460c G7, BIOS I27 12/03/2012 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825054] ffffffffffffffe2 ffff88108c945a88 ffffffff81750690 ffff88180bacfff0 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825064] ffff88174196d000 ffff88108c945ad8 ffffffffa052f667 ffffffffffffffe2 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825072] 0000000000001000 ffff88108c945b58 ffff88175e870000 ffff8811ada4f000 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825087] Call Trace: </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825103] [<ffffffff81750690>] dump_stack+0x46/0x58 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825154] [<ffffffffa052f667>] ocfs2_start_trans+0x1d7/0x200 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825183] [<ffffffffa0505b60>] ocfs2_write_begin_nolock+0xda0/0x1c70 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825216] [<ffffffffa052b7cb>] ? ocfs2_read_inode_block_full+0x3b/0x60 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825248] [<ffffffffa051a82f>] ? ocfs2_inode_lock_full_nested+0x52f/0xc60 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825277] [<ffffffffa0516060>] ? ocfs2_should_refresh_lock_res+0x80/0x190 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825304] [<ffffffffa0506b36>] ocfs2_write_begin+0x106/0x230 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825330] [<ffffffffa05180ab>] ? __ocfs2_cluster_unlock.isra.27+0x9b/0xe0 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825342] [<ffffffff8115342b>] generic_file_buffered_write+0xfb/0x280 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825370] [<ffffffffa051a1c5>] ? ocfs2_rw_lock+0x75/0x1b0 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825398] [<ffffffffa0527f3f>] ocfs2_file_aio_write+0x79f/0x830 [ocfs2] </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825407] [<ffffffff811c14ba>] do_sync_write+0x5a/0x90 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825413] [<ffffffff811c1fc5>] vfs_write+0xc5/0x1f0 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825418] [<ffffffff811c24c2>] SyS_write+0x52/0xa0 </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825426] [<ffffffff8176106d>] system_call_fastpath+0x1a/0x1f </span><br style="line-height:18px; font-size:12px"><span style="font-size:12px; line-height:18px">Aug 11 11:32:25 cvknode73 kernel: [678904.825431] OCFS2: abort (device sdu): ocfs2_start_trans: Detected aborted journal </span></div></blockquote></pre>
</div>
</div>
<div><br>
</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 class="FoxDiv20151014150315911581">
<p><font size="2"><br>
Message: 8<br>
Date: Fri, 28 Aug 2015 16:45:44 -0700<br>
From: Mark Fasheh <mfasheh@suse.de><br>
Subject: Re: [Ocfs2-devel] [patch 04/28] ocfs2: add errors=continue<br>
To: akpm@linux-foundation.org<br>
Cc: ocfs2-devel@oss.oracle.com, rgoldwyn@suse.com<br>
Message-ID: <20150828234544.GN1145@wotan.suse.de><br>
Content-Type: text/plain; charset=us-ascii<br>
<br>
On Wed, Aug 26, 2015 at 03:11:29PM -0700, Andrew Morton wrote:<br>
> From: Goldwyn Rodrigues <rgoldwyn@suse.de><br>
> Subject: ocfs2: add errors=continue<br>
><br>
> OCFS2 is often used in high-availaibility systems. However, ocfs2<br>
> converts the filesystem to read-only at the drop of the hat. This may not<br>
> be necessary, since turning the filesystem read-only would affect other<br>
> running processes as well, decreasing availability.<br>
><br>
> This attempt is to add errors=continue, which would return the EIO to the<br>
> calling process and terminate furhter processing so that the filesystem is<br>
> not corrupted further. However, the filesystem is not converted to<br>
> read-only.<br>
><br>
> As a future plan, I intend to create a small utility or extend fsck.ocfs2<br>
> to fix small errors such as in the inode. The input to the utility such<br>
> as the inode can come from the kernel logs so we don't have to schedule a<br>
> downtime for fixing small-enough errors.<br>
><br>
> The patch changes the ocfs2_error to return an error. The error returned<br>
> depends on the mount option set. If none is set, the default is to turn<br>
> the filesystem read-only.<br>
><br>
> Perhaps errors=continue is not the best option name. Historically it is<br>
> used for making an attempt to progress in the current process itself.<br>
> Should we call it errors=eio? or errors=killproc? Suggestions/Comments<br>
> welcome.<br>
<br>
errors=continue seems fine to me, thanks for this Goldwyn.<br>
<br>
<br>
><br>
> Sources are available at:<br>
> <a href="https://github.com/goldwynr/linux/tree/error-cont">https://github.com/goldwynr/linux/tree/error-cont</a><br>
><br>
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com><br>
> Cc: Mark Fasheh <mfasheh@suse.com><br>
> Cc: Joel Becker <jlbec@evilplan.org><br>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org><br>
Reviewed-by: Mark Fasheh <mfasheh@suse.de><br>
<br>
<br>
> ---<br>
><br>
> fs/ocfs2/ocfs2.h | 2 +<br>
> fs/ocfs2/super.c | 59 ++++++++++++++++++++++++++++++++-------------<br>
> fs/ocfs2/super.h | 2 -<br>
> 3 files changed, 45 insertions(+), 18 deletions(-)<br>
><br>
> diff -puN fs/ocfs2/ocfs2.h~add-errors=continue fs/ocfs2/ocfs2.h<br>
> --- a/fs/ocfs2/ocfs2.h~add-errors=continue<br>
> +++ a/fs/ocfs2/ocfs2.h<br>
> @@ -286,6 +286,8 @@ enum ocfs2_mount_options<br>
> OCFS2_MOUNT_HB_GLOBAL = 1 << 14, /* Global heartbeat */<br>
> <br>
> OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT = 1 << 15, /* Journal Async Commit */<br>
> + OCFS2_MOUNT_ERRORS_CONT = 1 << 16, /* Return EIO to the calling process on error */<br>
> + OCFS2_MOUNT_ERRORS_ROFS = 1 << 17, /* Change filesystem to read-only on error */<br>
> };<br>
> <br>
> #define OCFS2_OSB_SOFT_RO 0x0001<br>
> diff -puN fs/ocfs2/super.c~add-errors=continue fs/ocfs2/super.c<br>
> --- a/fs/ocfs2/super.c~add-errors=continue<br>
> +++ a/fs/ocfs2/super.c<br>
> @@ -192,6 +192,7 @@ enum {<br>
> Opt_resv_level,<br>
> Opt_dir_resv_level,<br>
> Opt_journal_async_commit,<br>
> + Opt_err_cont,<br>
> Opt_err,<br>
> };<br>
> <br>
> @@ -224,6 +225,7 @@ static const match_table_t tokens = {<br>
> {Opt_resv_level, "resv_level=%u"},<br>
> {Opt_dir_resv_level, "dir_resv_level=%u"},<br>
> {Opt_journal_async_commit, "journal_async_commit"},<br>
> + {Opt_err_cont, "errors=continue"},<br>
> {Opt_err, NULL}<br>
> };<br>
> <br>
> @@ -1330,10 +1332,19 @@ static int ocfs2_parse_options(struct su<br>
> mopt->mount_opt |= OCFS2_MOUNT_NOINTR;<br>
> break;<br>
> case Opt_err_panic:<br>
> + mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_CONT;<br>
> + mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_ROFS;<br>
> mopt->mount_opt |= OCFS2_MOUNT_ERRORS_PANIC;<br>
> break;<br>
> case Opt_err_ro:<br>
> + mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_CONT;<br>
> mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC;<br>
> + mopt->mount_opt |= OCFS2_MOUNT_ERRORS_ROFS;<br>
> + break;<br>
> + case Opt_err_cont:<br>
> + mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_ROFS;<br>
> + mopt->mount_opt &= ~OCFS2_MOUNT_ERRORS_PANIC;<br>
> + mopt->mount_opt |= OCFS2_MOUNT_ERRORS_CONT;<br>
> break;<br>
> case Opt_data_ordered:<br>
> mopt->mount_opt &= ~OCFS2_MOUNT_DATA_WRITEBACK;<br>
> @@ -1530,6 +1541,8 @@ static int ocfs2_show_options(struct seq<br>
> <br>
> if (opts & OCFS2_MOUNT_ERRORS_PANIC)<br>
> seq_printf(s, ",errors=panic");<br>
> + else if (opts & OCFS2_MOUNT_ERRORS_CONT)<br>
> + seq_printf(s, ",errors=continue");<br>
> else<br>
> seq_printf(s, ",errors=remount-ro");<br>
> <br>
> @@ -2539,31 +2552,43 @@ static void ocfs2_delete_osb(struct ocfs<br>
> memset(osb, 0, sizeof(struct ocfs2_super));<br>
> }<br>
> <br>
> -/* Put OCFS2 into a readonly state, or (if the user specifies it),<br>
> - * panic(). We do not support continue-on-error operation. */<br>
> -static void ocfs2_handle_error(struct super_block *sb)<br>
> +/* Depending on the mount option passed, perform one of the following:<br>
> + * Put OCFS2 into a readonly state (default)<br>
> + * Return EIO so that only the process errs<br>
> + * Fix the error as if fsck.ocfs2 -y<br>
> + * panic<br>
> + */<br>
> +static int ocfs2_handle_error(struct super_block *sb)<br>
> {<br>
> struct ocfs2_super *osb = OCFS2_SB(sb);<br>
> + int rv = 0;<br>
> +<br>
> + ocfs2_set_osb_flag(osb, OCFS2_OSB_ERROR_FS);<br>
> + pr_crit("On-disk corruption discovered. "<br>
> + "Please run fsck.ocfs2 once the filesystem is unmounted.\n");<br>
> <br>
> - if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_PANIC)<br>
> + if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_PANIC) {<br>
> panic("OCFS2: (device %s): panic forced after error\n",<br>
> sb->s_id);<br>
> + } else if (osb->s_mount_opt & OCFS2_MOUNT_ERRORS_CONT) {<br>
> + pr_crit("OCFS2: Returning error to the calling process.\n");<br>
> + rv = -EIO;<br>
> + } else { /* default option */<br>
> + rv = -EROFS;<br>
> + if (sb->s_flags & MS_RDONLY &&<br>
> + (ocfs2_is_soft_readonly(osb) ||<br>
> + ocfs2_is_hard_readonly(osb)))<br>
> + return rv;<br>
> <br>
> - ocfs2_set_osb_flag(osb, OCFS2_OSB_ERROR_FS);<br>
> -<br>
> - if (sb->s_flags & MS_RDONLY &&<br>
> - (ocfs2_is_soft_readonly(osb) ||<br>
> - ocfs2_is_hard_readonly(osb)))<br>
> - return;<br>
> + pr_crit("OCFS2: File system is now read-only.\n");<br>
> + sb->s_flags |= MS_RDONLY;<br>
> + ocfs2_set_ro_flag(osb, 0);<br>
> + }<br>
> <br>
> - printk(KERN_CRIT "File system is now read-only due to the potential "<br>
> - "of on-disk corruption. Please run fsck.ocfs2 once the file "<br>
> - "system is unmounted.\n");<br>
> - sb->s_flags |= MS_RDONLY;<br>
> - ocfs2_set_ro_flag(osb, 0);<br>
> + return rv;<br>
> }<br>
> <br>
> -void __ocfs2_error(struct super_block *sb, const char *function,<br>
> +int __ocfs2_error(struct super_block *sb, const char *function,<br>
> const char *fmt, ...)<br>
> {<br>
> struct va_format vaf;<br>
> @@ -2580,7 +2605,7 @@ void __ocfs2_error(struct super_block *s<br>
> <br>
> va_end(args);<br>
> <br>
> - ocfs2_handle_error(sb);<br>
> + return ocfs2_handle_error(sb);<br>
> }<br>
> <br>
> /* Handle critical errors. This is intentionally more drastic than<br>
> diff -puN fs/ocfs2/super.h~add-errors=continue fs/ocfs2/super.h<br>
> --- a/fs/ocfs2/super.h~add-errors=continue<br>
> +++ a/fs/ocfs2/super.h<br>
> @@ -32,7 +32,7 @@ int ocfs2_publish_get_mount_state(struct<br>
> int node_num);<br>
> <br>
> __printf(3, 4)<br>
> -void __ocfs2_error(struct super_block *sb, const char *function,<br>
> +int __ocfs2_error(struct super_block *sb, const char *function,<br>
> const char *fmt, ...);<br>
> <br>
> #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args)<br>
> _<br>
--<br>
Mark Fasheh<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Ocfs2-devel mailing list<br>
Ocfs2-devel@oss.oracle.com<br>
<a href="https://oss.oracle.com/mailman/listinfo/ocfs2-devel">https://oss.oracle.com/mailman/listinfo/ocfs2-devel</a><br>
<br>
End of Ocfs2-devel Digest, Vol 138, Issue 31<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:"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>