aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2015-12-10 11:08:59 +0000
committerFilipe Manana <fdmanana@suse.com>2015-12-10 11:23:24 +0000
commit8a7d656f3dfb7889316ba57502f1eaa6106fd6f8 (patch)
tree7ceb81382f358d878240a8d56a61928c164850a5 /fs
parentBtrfs: fix unprotected list move from unused_bgs to deleted_bgs list (diff)
downloadlinux-dev-8a7d656f3dfb7889316ba57502f1eaa6106fd6f8.tar.xz
linux-dev-8a7d656f3dfb7889316ba57502f1eaa6106fd6f8.zip
Btrfs: fix transaction handle leak in balance
If we fail to allocate a new data chunk, we were jumping to the error path without release the transaction handle we got before. Fix this by always releasing it before doing the jump. Fixes: 2c9fe8355258 ("btrfs: Fix lost-data-profile caused by balance bg") Signed-off-by: Filipe Manana <fdmanana@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 750285e4f274..86124cde907a 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -3548,12 +3548,11 @@ again:
ret = btrfs_force_chunk_alloc(trans, chunk_root,
BTRFS_BLOCK_GROUP_DATA);
+ btrfs_end_transaction(trans, chunk_root);
if (ret < 0) {
mutex_unlock(&fs_info->delete_unused_bgs_mutex);
goto error;
}
-
- btrfs_end_transaction(trans, chunk_root);
chunk_reserved = 1;
}