From patchwork Tue Sep 6 08:03:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9315909 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 623C460752 for ; Tue, 6 Sep 2016 08:04:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61DA52861C for ; Tue, 6 Sep 2016 08:04:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 553B4288DA; Tue, 6 Sep 2016 08:04:43 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD3BC286F5 for ; Tue, 6 Sep 2016 08:04:40 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id DD2F47CA3; Tue, 6 Sep 2016 03:04:38 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id 9B5687CA1 for ; Tue, 6 Sep 2016 03:04:36 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay1.corp.sgi.com (Postfix) with ESMTP id 6017A8F8035 for ; Tue, 6 Sep 2016 01:04:33 -0700 (PDT) X-ASG-Debug-ID: 1473149068-0bf57b15a51c8920001-NocioJ Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by cuda.sgi.com with ESMTP id 61z1jJo6nHxiFWVE (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 06 Sep 2016 01:04:29 -0700 (PDT) X-Barracuda-Envelope-From: guaneryu@gmail.com X-Barracuda-Effective-Source-IP: mail-pf0-f193.google.com[209.85.192.193] X-Barracuda-Apparent-Source-IP: 209.85.192.193 Received: by mail-pf0-f193.google.com with SMTP id h186so10995674pfg.2 for ; Tue, 06 Sep 2016 01:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=wnQcj8JRgwTUOvuvrPq6mRD+pFWfVL6vdOgFdIFsTCg=; b=twqU/cOXSArxv5QeyPTMj7YCQ9B/R+nDBy9QalB1FPVdNibrUyGsoqNNZ7zZ99v4k8 nyOYCxfN6926KIwrv3BBGvpA2dJaGMB0dEIgJ8imzpjNPdm3YSlMvpv489ohSGOXhFkB Hz7v5dP4og8PM83F2EkF4Vo5lVBzG9NTIgFgVfJr6nO1RI5vhRe1WzSa1EZqM9/NmSqQ JE5+i6ZcDokVQFil4ce2MN4uhUHdcClWGurgCKLnsJ7NyjXmgyil8ZPZg10ZjU66FxRA zkJUl1ie2AVRF9dIjw7zx5DKaQEZJw42ee78nsHfx3zeq+cEJrguDkH4mg0VSrLaOHMl eOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wnQcj8JRgwTUOvuvrPq6mRD+pFWfVL6vdOgFdIFsTCg=; b=jG7hJKQFuhaJ8c/xifLcBHUIPav/F5Mk2f+sN11fDkglZvnacLWBNYPOOrx8EFSFuA UdGRfn+pInLzCE46ff0DAHDi14ajPMr/M3HX1HH9o23eruMt0rge0wpNC7bJndF0AA4+ wsAjIURKbY+WwudYRljgZ+XgjT46H6J/NggTA/ZSYa2/X47MgT3S+1//qlk5fC9AzJsT lABKU155tX0XDaXlfPdjsBT8zP3DBZIrYgaPpsa8l5/RKza77QgfzYSQq2zIxjYmfxhW 6QMLA2sGP/i8qYME4eDxEc9EFrdGLog9MLQJ1Typv2yKAoI0/PpqID4iJgaSvPDA/j4O LEYg== X-Gm-Message-State: AE9vXwMcYyRQ2lhhfPx38Gg91eKAbzmmMM8iq+9zhQxIEmPKCOfWS8DCYUtF4X54qciREg== X-Received: by 10.98.27.11 with SMTP id b11mr69972080pfb.111.1473149068553; Tue, 06 Sep 2016 01:04:28 -0700 (PDT) Received: from localhost ([128.199.137.77]) by smtp.gmail.com with ESMTPSA id m82sm15601260pfk.64.2016.09.06.01.04.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Sep 2016 01:04:27 -0700 (PDT) From: Eryu Guan To: linux-xfs@vger.kernel.org Subject: [PATCH] xfs: undo block reservation correctly in xfs_trans_reserve() Date: Tue, 6 Sep 2016 16:03:59 +0800 X-ASG-Orig-Subj: [PATCH] xfs: undo block reservation correctly in xfs_trans_reserve() Message-Id: <1473149039-30487-1-git-send-email-guaneryu@gmail.com> X-Mailer: git-send-email 2.7.4 X-Barracuda-Connect: mail-pf0-f193.google.com[209.85.192.193] X-Barracuda-Start-Time: 1473149069 X-Barracuda-Encrypted: ECDHE-RSA-AES128-GCM-SHA256 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 702 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests=BSF_SC0_MISMATCH_TO, DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.32647 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature Cc: Eryu Guan , xfs@oss.sgi.com X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP "blocks" should be added back to fdblocks at undo time, not taken away, i.e. the minus sign should not be used. Fixes: 0d485ada404b ("xfs: use generic percpu counters for free block counter") Signed-off-by: Eryu Guan --- fs/xfs/xfs_trans.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 5f3d33d..011dace 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -217,7 +217,7 @@ undo_log: undo_blocks: if (blocks > 0) { - xfs_mod_fdblocks(tp->t_mountp, -((int64_t)blocks), rsvd); + xfs_mod_fdblocks(tp->t_mountp, ((int64_t)blocks), rsvd); tp->t_blk_res = 0; }