aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/qgroup.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>2013-04-07 06:50:20 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:54:41 -0400
commitddb47afa50f2f2713ef28d22380d3bf8fae648db (patch)
tree21b006b1068044a04abec8228ace43f0cff96c53 /fs/btrfs/qgroup.c
parent3f5e2d3b3877d34231bbe45856f3b78b7692e472 (diff)
Btrfs: fix a warning when updating qgroup limit
Step to reproduce: mkfs.btrfs <disk> mount <disk> <mnt> btrfs quota enable <mnt> btrfs qgroup limit 0/1 <mnt> dmesg If the relative qgroup dosen't exist, flag 'BTRFS_QGROUP_STATUS_ FLAG_INCONSISTENT' will be set, and print the noise message. This is wrong, we can just move find_qgroup_rb() before update_qgroup_limit_item().this dosen't change the logic of the function. But it can avoid unnecessary noise message and wrong set of flag. Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r--fs/btrfs/qgroup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 2293da6f9e72..e089fc108483 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1092,6 +1092,11 @@ int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
1092 goto out; 1092 goto out;
1093 } 1093 }
1094 1094
1095 qgroup = find_qgroup_rb(fs_info, qgroupid);
1096 if (!qgroup) {
1097 ret = -ENOENT;
1098 goto out;
1099 }
1095 ret = update_qgroup_limit_item(trans, quota_root, qgroupid, 1100 ret = update_qgroup_limit_item(trans, quota_root, qgroupid,
1096 limit->flags, limit->max_rfer, 1101 limit->flags, limit->max_rfer,
1097 limit->max_excl, limit->rsv_rfer, 1102 limit->max_excl, limit->rsv_rfer,
@@ -1102,11 +1107,6 @@ int btrfs_limit_qgroup(struct btrfs_trans_handle *trans,
1102 (unsigned long long)qgroupid); 1107 (unsigned long long)qgroupid);
1103 } 1108 }
1104 1109
1105 qgroup = find_qgroup_rb(fs_info, qgroupid);
1106 if (!qgroup) {
1107 ret = -ENOENT;
1108 goto out;
1109 }
1110 spin_lock(&fs_info->qgroup_lock); 1110 spin_lock(&fs_info->qgroup_lock);
1111 qgroup->lim_flags = limit->flags; 1111 qgroup->lim_flags = limit->flags;
1112 qgroup->max_rfer = limit->max_rfer; 1112 qgroup->max_rfer = limit->max_rfer;