From patchwork Mon Jun 17 14:08:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Goldwyn Rodriues X-Patchwork-Id: 2733541 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F3819F472 for ; Mon, 17 Jun 2013 14:09:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E3DC20177 for ; Mon, 17 Jun 2013 14:09:49 +0000 (UTC) Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C053D2016E for ; Mon, 17 Jun 2013 14:09:44 +0000 (UTC) Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r5HE91CX008604 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 Jun 2013 14:09:02 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 r5HE8xDx024854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 17 Jun 2013 14:09:00 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Uoa79-00007a-MA; Mon, 17 Jun 2013 07:08:59 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Uoa6e-00005U-BR for ocfs2-devel@oss.oracle.com; Mon, 17 Jun 2013 07:08:28 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r5HE8R1V002676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jun 2013 14:08:28 GMT Received: from mail-yh0-f51.google.com (mail-yh0-f51.google.com [209.85.213.51]) by aserp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r5HE8QRY028608 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 17 Jun 2013 14:08:27 GMT Received: by mail-yh0-f51.google.com with SMTP id l109so1031984yhq.24 for ; Mon, 17 Jun 2013 07:08:26 -0700 (PDT) X-Received: by 10.236.27.78 with SMTP id d54mr7967178yha.34.1371478106888; Mon, 17 Jun 2013 07:08:26 -0700 (PDT) Received: from shrek.cartoons (c-75-64-61-89.hsd1.tn.comcast.net. [75.64.61.89]) by mx.google.com with ESMTPSA id g39sm24609537yhb.13.2013.06.17.07.08.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Jun 2013 07:08:26 -0700 (PDT) Date: Mon, 17 Jun 2013 09:08:24 -0500 From: Goldwyn Rodrigues To: ocfs2-devel@oss.oracle.com Message-ID: <20130617140824.GA8554@shrek.cartoons> Mail-Followup-To: ocfs2-devel@oss.oracle.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.213.51 ct-class=R5 ct-vol1=-93 ct-vol2=7 ct-vol3=6 ct-risk=50 ct-spam1=82 ct-spam2=4 ct-bulk=2 rcpts=1 size=911 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=P+ID2Ewu c=1 sm=1 tr=0 a=x49FHliA+Ap1NUA8iu/DWQ==:117 a=d9OfPU+c/iNwybyNyKUfsg==:17 a=LcaDllckn3IA:10 a=MCGLTgCs9gYA:10 a=nDghuxUhq_wA:10 a=o0B0tjt6tGQA:10 a=kj9zAlcOel0A:10 a=pGLkceISAAAA:8 a=iox4zFpeAAAA:8 a=1XWaLZrsAAAA:8 a=y PCof4ZbAAAA:8 a=C_IRinGWAAAA:8 a=lS0MHldHvS4A:10 a=eBV_5gQtTaIA:10 a=hn_lVhrW_V2QiwoDvHAA:9 a=CjuIK1q_8ugA:10 a=n9GBPR9yFnkA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090206.51BF185B.0105, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [Ocfs2-devel] [PATCH] Add bits_wanted while calculating credits in ocfs2_calc_extend_credits X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: rgoldwyn@suse.com 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.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,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 While adding extends to a file, the credits are calculated incorrectly and if the requested clusters is more than one (or more because we used a conservative limit) then we run out of journal credits and we hit an assert in journalling code. The function parameter bits_wanted variable was not used at all. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Jie Liu --- diff --git a/fs/ocfs2/journal.h b/fs/ocfs2/journal.h index a3385b6..7d927cd 100644 --- a/fs/ocfs2/journal.h +++ b/fs/ocfs2/journal.h @@ -538,7 +538,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); + ocfs2_quota_trans_credits(sb) + bits_wanted; } static inline int ocfs2_calc_symlink_credits(struct super_block *sb)