From: David Sterba Date: Mon, 13 Feb 2017 13:05:24 +0000 (+0100) Subject: btrfs: check quota status earlier and don't do unnecessary frees X-Git-Tag: v4.14-rc1~1080^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=81353d50f5274e435105391b669e05aaf62c8609;p=platform%2Fkernel%2Flinux-rpi3.git btrfs: check quota status earlier and don't do unnecessary frees Status of quotas should be the first check in btrfs_qgroup_account_extent and we can return immediatelly, no need to do no-op ulist frees. Signed-off-by: David Sterba --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 627126d..0d3c9a1 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -1945,13 +1945,14 @@ btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 nr_old_roots = 0; int ret = 0; + if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) + return 0; + if (new_roots) nr_new_roots = new_roots->nnodes; if (old_roots) nr_old_roots = old_roots->nnodes; - if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) - goto out_free; BUG_ON(!fs_info->quota_root); trace_btrfs_qgroup_account_extent(fs_info, bytenr, num_bytes,