From patchwork Fri Aug 2 10:17:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "jeff.liu" X-Patchwork-Id: 2837723 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4B9CBBF535 for ; Fri, 2 Aug 2013 10:17:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 22E51204B2 for ; Fri, 2 Aug 2013 10:17:48 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 19C98204C8 for ; Fri, 2 Aug 2013 10:17:44 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r72AH7G2021441 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Aug 2013 10:17:08 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r72AGxhh004103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Aug 2013 10:17:01 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V5CPr-0006Lu-Cb; Fri, 02 Aug 2013 03:16:59 -0700 Received: from ucsinet21.oracle.com ([156.151.31.93]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1V5CPc-0006LF-62 for ocfs2-devel@oss.oracle.com; Fri, 02 Aug 2013 03:16:44 -0700 Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r72AGg2o023830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 2 Aug 2013 10:16:43 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r72AGgH4029473; Fri, 2 Aug 2013 10:16:42 GMT Received: from [192.168.1.103] (/221.223.96.241) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 02 Aug 2013 03:16:42 -0700 Message-ID: <51FB8723.4030907@oracle.com> Date: Fri, 02 Aug 2013 18:17:07 +0800 From: Jeff Liu User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1 MIME-Version: 1.0 To: Ocfs2-Devel Cc: Goldwyn Rodrigues Subject: [Ocfs2-devel] [PATCH] ocfs2: Revert commit 40bd62e to avoid regression in extended allocation 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: acsinet22.oracle.com [141.146.126.238] X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, 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 From: Jie Liu Revert "fs/ocfs2/journal.h: add bits_wanted while calculating credits in ocfs2_calc_extend_credits" This reverts commit 40bd62eb7fb8447798732e809a676ebaf2a7f910. Unfortunately this change broken fallocate even if there has sufficient disk space can be preallocated, which is a serious problem. # df -h /dev/sda8 22G 1.2G 21G 6% /ocfs2 # fallocate -o 0 -l 200M /ocfs2/testfile fallocate: /ocfs2/test: fallocate failed: No space left on device CPU: 3 PID: 3656 Comm: fallocate Tainted: G W O 3.11.0-rc3 #2 Call Trace: [] dump_stack+0x77/0x9e [] warn_slowpath_common+0xc4/0x110 [] warn_slowpath_null+0x2a/0x40 [] start_this_handle+0x6c/0x640 [jbd2] [] ? __module_address+0x1ad/0x270 [] ? is_module_address+0x1e/0x40 [] ? static_obj+0x65/0xb0 [] ? lockdep_init_map+0x147/0x280 [] jbd2__journal_start+0x138/0x300 [jbd2] [] jbd2_journal_start+0x23/0x30 [jbd2] [] ocfs2_start_trans+0x166/0x300 [ocfs2] [] ? show_stack+0x66/0x70 [] __ocfs2_extend_allocation+0x38f/0xdb0 [ocfs2] [] ? ocfs2_get_clusters_nocache.isra.11+0x234/0x5b0 [] ? ocfs2_read_inode_block_full+0x43/0x80 [ocfs2] [] ? ocfs2_extend_trans+0x2c0/0x2c0 [ocfs2] [] ? __ocfs2_change_file_space+0x57e/0xa60 [ocfs2] [] ocfs2_allocate_unwritten_extents+0x3c9/0x520 [] ? down_write+0x108/0x120 [] __ocfs2_change_file_space+0x5e0/0xa60 [ocfs2] [] ? do_fallocate+0x1ad/0x220 [] ocfs2_fallocate+0xb1/0xe0 [ocfs2] [] do_fallocate+0x1cb/0x220 [] SyS_fallocate+0x6f/0xb0 [] system_call_fastpath+0x16/0x1b ---[ end trace 474a79e9fc2db862 ]--- [ 1683.855972] JBD2: fallocate wants too many credits (51216 > 4381) Cc: Goldwyn Rodrigues Cc: Joel Becker Cc: Mark Fasheh Signed-off-by: Jie Liu --- fs/ocfs2/journal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index 96f9ac2..0a99273 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -537,7 +537,7 @@ static inline int ocfs2_calc_extend_credits(struct super_block *sb, extent_blocks = 1 + 1 + le16_to_cpu(root_el->l_tree_depth); return bitmap_blocks + sysfile_bitmap_blocks + extent_blocks + - ocfs2_quota_trans_credits(sb) + bits_wanted; + ocfs2_quota_trans_credits(sb); } static inline int ocfs2_calc_symlink_credits(struct super_block *sb)