aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2016-08-31 19:43:33 -0400
committerDavid Sterba <dsterba@suse.com>2016-09-01 11:16:47 -0400
commita9b1fc851db054ddec703dc7951ed00620600b26 (patch)
treea1a6ffb52cf194aa5593f848a665ae9bf7fa4c5f /fs
parent3dc09ec895f098cedd789a620c90ff1bf7f779a1 (diff)
Btrfs: fix endless loop in balancing block groups
Qgroup function may overwrite the saved error 'err' with 0 in case quota is not enabled, and this ends up with a endless loop in balance because we keep going back to balance the same block group. It really should use 'ret' instead. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/relocation.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 8a2c2a07987b..c0c13dc6fe12 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4200,9 +4200,11 @@ restart:
4200 err = PTR_ERR(trans); 4200 err = PTR_ERR(trans);
4201 goto out_free; 4201 goto out_free;
4202 } 4202 }
4203 err = qgroup_fix_relocated_data_extents(trans, rc); 4203 ret = qgroup_fix_relocated_data_extents(trans, rc);
4204 if (err < 0) { 4204 if (ret < 0) {
4205 btrfs_abort_transaction(trans, err); 4205 btrfs_abort_transaction(trans, ret);
4206 if (!err)
4207 err = ret;
4206 goto out_free; 4208 goto out_free;
4207 } 4209 }
4208 btrfs_commit_transaction(trans, rc->extent_root); 4210 btrfs_commit_transaction(trans, rc->extent_root);