aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorYang Dongsheng <yangds.fnst@cn.fujitsu.com>2015-01-06 07:54:42 -0500
committerChris Mason <clm@fb.com>2015-01-21 21:22:37 -0500
commit0ee13fe28ce387864c0d2b1e8c52b64abe2fcd02 (patch)
tree3d0d556d357af39c09a21eef88eb0b11deece387 /fs/btrfs
parent26455d3318a1e2a38f783db07981e3ed67de40ed (diff)
btrfs: qgroup: move WARN_ON() to the correct location.
In function qgroup_excl_accounting(), we need to WARN when qg->excl is less than what we want to free, same to child and parents. But currently, for parent qgroup, the WARN_ON() is located after freeing qg->excl. It will WARN out even we free it normally. This patch move this WARN_ON() before freeing qg->excl. Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com> Reviewed-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/qgroup.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 48b60dbf807f..97159a8e91d4 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1431,9 +1431,8 @@ static int qgroup_excl_accounting(struct btrfs_fs_info *fs_info,
1431 qgroup = u64_to_ptr(unode->aux); 1431 qgroup = u64_to_ptr(unode->aux);
1432 qgroup->rfer += sign * oper->num_bytes; 1432 qgroup->rfer += sign * oper->num_bytes;
1433 qgroup->rfer_cmpr += sign * oper->num_bytes; 1433 qgroup->rfer_cmpr += sign * oper->num_bytes;
1434 WARN_ON(sign < 0 && qgroup->excl < oper->num_bytes);
1434 qgroup->excl += sign * oper->num_bytes; 1435 qgroup->excl += sign * oper->num_bytes;
1435 if (sign < 0)
1436 WARN_ON(qgroup->excl < oper->num_bytes);
1437 qgroup->excl_cmpr += sign * oper->num_bytes; 1436 qgroup->excl_cmpr += sign * oper->num_bytes;
1438 qgroup_dirty(fs_info, qgroup); 1437 qgroup_dirty(fs_info, qgroup);
1439 1438