From patchwork Mon Jul 6 02:29:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangguanghui X-Patchwork-Id: 6719511 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 71DD09F380 for ; Mon, 6 Jul 2015 02:36:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A4E220642 for ; Mon, 6 Jul 2015 02:36:35 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A7E332060F for ; Mon, 6 Jul 2015 02:36:33 +0000 (UTC) Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t662aMhZ010364 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 6 Jul 2015 02:36:22 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id t662aLVc023310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Jul 2015 02:36:21 GMT Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1ZBwGb-0004Id-EY; Sun, 05 Jul 2015 19:36:21 -0700 Received: from aserv0022.oracle.com ([141.146.126.234]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1ZBwGD-0004I1-9W for ocfs2-devel@oss.oracle.com; Sun, 05 Jul 2015 19:35:57 -0700 Received: from aserp1020.oracle.com (aserp1020.oracle.com [141.146.126.67]) by aserv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t662Zu8L007685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Jul 2015 02:35:56 GMT Received: from userp2040.oracle.com (userp2040.oracle.com [156.151.31.90]) by aserp1020.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t662ZtQ2009999 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 6 Jul 2015 02:35:56 GMT Received: from pps.filterd (userp2040.oracle.com [127.0.0.1]) by userp2040.oracle.com (8.14.7/8.14.7) with SMTP id t662Yq1d021820 for ; Mon, 6 Jul 2015 02:35:55 GMT Received: from h3cmg01-ex.h3c.com (smtp.h3c.com [60.191.123.56] (may be forged)) by userp2040.oracle.com with ESMTP id 1vetsbbtm6-1 for ; Mon, 06 Jul 2015 02:35:55 +0000 Received: from H3CHUB04-EX.srv.huawei-3com.com (unknown [10.63.20.170]) by h3cmg01-ex.h3c.com with smtp id 2651_05ee_adcdf259_cd24_4646_b4ca_29f0f8d537df; Mon, 06 Jul 2015 10:30:06 +0800 Received: from H3CMLB14-EX.srv.huawei-3com.com ([fe80::f804:6772:bd71:f07f]) by H3CHUB04-EX.srv.huawei-3com.com ([fe80::5939:f6db:b05e:eaba%11]) with mapi id 14.01.0355.002; Mon, 6 Jul 2015 10:29:54 +0800 From: Zhangguanghui To: Joseph Qi , Andrew Morton Thread-Topic: [PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access Thread-Index: AQHQt5EycTssz5QxkEuRGHUnW/b39Q== Date: Mon, 6 Jul 2015 02:29:54 +0000 Message-ID: <2015070610294906954814@h3c.com> References: <5599E264.7080606@huawei.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.153.28.119] MIME-Version: 1.0 X-ServerName: [60.191.123.56] X-Proofpoint-Virus-Version: vendor=nai engine=5700 definitions=7853 signatures=670602 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0.9 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1506180000 definitions=main-1507060044 Cc: Mark Fasheh , "ocfs2-devel@oss.oracle.com" Subject: Re: [Ocfs2-devel] [PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: aserv0021.oracle.com [141.146.126.233] X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_50, HTML_FONT_LOW_CONTRAST, HTML_MESSAGE, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch is currently verified and working well for two weeks. So it is reasonable for the case. Finally, any feedback about this process (positive or negative) would be greatly appreciated. ________________________________ zhangguanghui From: Joseph Qi Date: 2015-07-06 10:05 To: Andrew Morton CC: Mark Fasheh; Joel Becker; zhangguanghui 10102 (CCPL); ocfs2-devel@oss.oracle.com Subject: [PATCH] ocfs2: do not BUG if buffer not uptodate in __ocfs2_journal_access When storage network is unstable, it may trigger the BUG in __ocfs2_journal_access because of buffer not uptodate. We can retry the write in this case or return error instead of BUG. Reported-by: Zhangguanghui Signed-off-by: Joseph Qi --- fs/ocfs2/journal.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 1.8.4.3 ------------------------------------------------------------------------------------------------------------------------------------- ???????????????????????????????????????? ???????????????????????????????????????? ???????????????????????????????????????? ??? This e-mail and its attachments contain confidential information from H3C, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it! diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index f8206d1..e731374 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -670,7 +670,23 @@ static int __ocfs2_journal_access(handle_t *handle, mlog(ML_ERROR, "giving me a buffer that's not uptodate!\n"); mlog(ML_ERROR, "b_blocknr=%llu\n", (unsigned long long)bh->b_blocknr); - BUG(); + + lock_buffer(bh); + /* + * A previous attempt to write this buffer head failed. + * Nothing we can do but to retry the write and hope for + * the best. + */ + if (buffer_write_io_error(bh) && !buffer_uptodate(bh)) { + clear_buffer_write_io_error(bh); + set_buffer_uptodate(bh); + } + + if (!buffer_uptodate(bh)) { + unlock_buffer(bh); + return -EIO; + } + unlock_buffer(bh); } /* Set the current transaction information on the ci so