From patchwork Thu Jan 25 01:18:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changwei Ge X-Patchwork-Id: 10183465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 871C060383 for ; Thu, 25 Jan 2018 01:25:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 730A2289AE for ; Thu, 25 Jan 2018 01:25:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66DFC289C4; Thu, 25 Jan 2018 01:25:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 216AB289AE for ; Thu, 25 Jan 2018 01:25:29 +0000 (UTC) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0P1Mb0C052475; Thu, 25 Jan 2018 01:24:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : date : message-id : mime-version : cc : subject : list-id : list-unsubscribe : list-archive : list-post : list-help : list-subscribe : content-type : content-transfer-encoding : sender; s=corp-2017-10-26; bh=EEe7reZ1si96YKNSX6HXsPiHVcCKjCVrOAGkgS4nQ5Q=; b=Nqgd8BlxPqdtKMgseu0XEfBJcqBt2oXkQTeEl4b2LjYgFBluRBmQI0UHboLbUzWW+n6X 0uI27Ad+z2u3gFo6neNuykODKI8uUsEo2fZ4npgzZywTBs8IpWOTjuh47MQFh9aE4c+a e/Zir+rzohpYNcoDM3ma2EwwnZfnAvoyqS+8pKWbarH6yciqC47zBIPppTkQ/aDBkbd/ 1KJ27U+0n1iWwHM/rTFl4DOoMz4F3XF4EJOK9vozB2jqaGM6ecemsDYszfqFBIfb0MiV OCH1wdsUnZaMPX+xFKs+4qjqPTW2yo2la0TtF/kHYhDdUgjlPK24SCOwAtj4W/C8d+M1 jQ== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2fq51rr378-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jan 2018 01:24:52 +0000 Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0P1JhWO028738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 25 Jan 2018 01:19:48 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 1eeWCd-0003eW-5Q; Wed, 24 Jan 2018 17:19:43 -0800 Received: from aserv0021.oracle.com ([141.146.126.233]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1eeWCI-0003ck-FL for ocfs2-devel@oss.oracle.com; Wed, 24 Jan 2018 17:19:23 -0800 Received: from userp2030.oracle.com (userp2030.oracle.com [156.151.31.89]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0P1JL08030816 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 25 Jan 2018 01:19:22 GMT Received: from pps.filterd (userp2030.oracle.com [127.0.0.1]) by userp2030.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0P1DIjG034462; Thu, 25 Jan 2018 01:19:21 GMT Received: from h3cmg01-ex.h3c.com (smtp.h3c.com [60.191.123.56]) by userp2030.oracle.com with ESMTP id 2fq2gk2m0d-1; Thu, 25 Jan 2018 01:19:20 +0000 Received: from BJHUB01-EX.srv.huawei-3com.com (unknown [10.63.20.169]) by h3cmg01-ex.h3c.com with smtp id 7214_02cc_2a3dc8a3_db78_4219_a13a_292617704526; Thu, 25 Jan 2018 09:18:02 +0800 Received: from localhost.localdomain (10.125.136.231) by rndsmtp.h3c.com (10.63.20.174) with Microsoft SMTP Server id 14.3.248.2; Thu, 25 Jan 2018 09:17:54 +0800 From: Changwei Ge To: , , , Date: Thu, 25 Jan 2018 09:18:15 +0800 Message-ID: <1516843095-23680-1-git-send-email-ge.changwei@h3c.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.125.136.231] X-CLX-Shades: MLX X-CLX-Response: 1TFkXGx0YEQpMehcaEQpZTRdnZnIRCllJFxpxGhAadwYbHxhxHB4QGncGGBo GGhEKWV4XaG55EQpJRhdFWEtJRk91WlhFTl9JXkNFRBl1T0sRCkNOF3hfXmIbe2V7U2JSbht/fB MYTVltfQdMU2NHSVBOZ0ByEQpYXBcfBBoEGxgfB05JHR4TGh1MBRsaBBsaGgQeEgQfEBseGh8aE QpeWRd4RF5/GhEKTVwXGBIZEQpMWhdoaUJNUxEKTU4XaBEKQ1oXHBoEGxMbBBsYGQQfHBEKQl4X GxEKRFgXGBEKRF4XHhEKREkXHhEKQkYXZxNtYBtbZUIffn0RCkJcFxoRCkJFF24ZWExeYQFwUkx hEQpCThdkQnxaRURBYh1kUBEKQkwXb35dTRgFXWYaUnsRCkJsF2RhT0tgQkgSeB1nEQpCQBdsfn tbf2FubW5behEKTV4XGxEKcGgXbGFJTFBNRWVvaEYQGRoRCnBoF2QBAUJhWm4eQEdgEBkaEQpwa BdjYRtlX0Uda31jbxAZGhEKcGgXawFLb2gZa2BLW2wQGRoRCnBoF2duTRobblhcHFhEEBkaEQpw bBdtThtvUwFHUkgdcxAZGhEKbX4XGxEKWE0XSxEg X-PDR: PASS X-Source-IP: 60.191.123.56 X-ServerName: smtp.h3c.com X-Proofpoint-SPF-Result: pass X-Proofpoint-SPF-Record: v=spf1 ip4:60.191.123.56 ip4:60.191.123.50 ip4:221.12.31.13 ip4:221.12.31.56 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8784 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=0 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=172 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=812 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801250015 X-Spam: Clean Cc: jack@suse.cz, ocfs2-devel@oss.oracle.com Subject: [Ocfs2-devel] [PATCH] ocfs2: unlock bh_state if bg check fails 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-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8784 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801250017 X-Virus-Scanned: ClamAV using ClamSMTP We should unlock bh_stat if bg->bg_free_bits_count > bg->bg_bits Suggested-by: Jan Kara Signed-off-by: Changwei Ge Reviewed-by: Gang He Reviewed-by: Jun Piao --- fs/ocfs2/suballoc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 71f22c8..6fee797 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c @@ -2441,6 +2441,8 @@ static int ocfs2_block_group_clear_bits(handle_t *handle, } le16_add_cpu(&bg->bg_free_bits_count, num_bits); if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) { + if (undo_fn) + jbd_unlock_bh_state(group_bh); return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n", (unsigned long long)le64_to_cpu(bg->bg_blkno), le16_to_cpu(bg->bg_bits),