From patchwork Fri Jun 5 23:07:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Maggard X-Patchwork-Id: 6558541 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7ED1BC0020 for ; Fri, 5 Jun 2015 23:07:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 845E220819 for ; Fri, 5 Jun 2015 23:07:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABC0520818 for ; Fri, 5 Jun 2015 23:07:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751474AbbFEXHh (ORCPT ); Fri, 5 Jun 2015 19:07:37 -0400 Received: from mail-qg0-f48.google.com ([209.85.192.48]:33005 "EHLO mail-qg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751256AbbFEXHg (ORCPT ); Fri, 5 Jun 2015 19:07:36 -0400 Received: by qgfa66 with SMTP id a66so563463qgf.0 for ; Fri, 05 Jun 2015 16:07:35 -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=LAtrzQq0zMyY8kUA7/9n/QUTaN03FgHcydA58SNsjA4=; b=dDA+j2/+BCu9yvAz2zMH5xob5nbKtzExa6FEHHkWFLoMEEDDvriiI8h6/Sq1/W257u C7YgAxZ1ySMH9pgDA0GZLDp7JuwPrPVZ2yn2K0DDC1kB7MQOQ5IMBK+/evBxVuiMRWih 1S5bXLCO4Mkjqn+RM4KRvWNEuW+Ub1bBQ+Br7eSemO/LSVQhV0pX1ypL4A+s72LG7qEq f/c1HRiRPMKnejPM3uREFByhuhRQw9Y19yDjmzYmSV4U4FBbb+uQ6XUIyJSSpEYkFbaK XghTyNKl1wnT4/n38HcqGSKoVxVjpyZ1yaas0upz4BNht1Eht14ncsfnp60pWvm4AP3e A9wg== X-Received: by 10.55.15.87 with SMTP id z84mr11336431qkg.57.1433545655777; Fri, 05 Jun 2015 16:07:35 -0700 (PDT) Received: from jmaggard-ThinkPad-W520.infrant-6.com ([209.249.181.1]) by mx.google.com with ESMTPSA id j66sm4635076qgj.8.2015.06.05.16.07.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 Jun 2015 16:07:34 -0700 (PDT) From: jmaggard10@gmail.com To: linux-btrfs@vger.kernel.org Cc: Justin Maggard Subject: [PATCH] Btrfs: Fix inverted no_quota logic Date: Fri, 5 Jun 2015 16:07:29 -0700 Message-Id: <1433545649-6134-1-git-send-email-jmaggard10@gmail.com> X-Mailer: git-send-email 2.4.2 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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: Justin Maggard Both btrfs_add_delayed_tree_ref() and btrfs_add_delayed_data_ref() have inverted logic when setting the no_quota value for delayed refs. This is eventually double-checked in __btrfs_inc_extent_ref() and __btrfs_free_extent(), but not alloc_reserved_tree_block(), so it can throw off qgroup accounting. Signed-off-by: Justin Maggard --- fs/btrfs/delayed-ref.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/delayed-ref.c b/fs/btrfs/delayed-ref.c index 8f8ed7d..b0ff795 100644 --- a/fs/btrfs/delayed-ref.c +++ b/fs/btrfs/delayed-ref.c @@ -792,7 +792,7 @@ int btrfs_add_delayed_tree_ref(struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_root *delayed_refs; if (!is_fstree(ref_root) || !fs_info->quota_enabled) - no_quota = 0; + no_quota = 1; BUG_ON(extent_op && extent_op->is_data); ref = kmem_cache_alloc(btrfs_delayed_tree_ref_cachep, GFP_NOFS); @@ -841,7 +841,7 @@ int btrfs_add_delayed_data_ref(struct btrfs_fs_info *fs_info, struct btrfs_delayed_ref_root *delayed_refs; if (!is_fstree(ref_root) || !fs_info->quota_enabled) - no_quota = 0; + no_quota = 1; BUG_ON(extent_op && !extent_op->is_data); ref = kmem_cache_alloc(btrfs_delayed_data_ref_cachep, GFP_NOFS);