summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2013-09-09 19:49:43 +0100
committerChris Mason <chris.mason@fusionio.com>2013-11-11 21:53:15 -0500
commite84cc14213e2c81ae5a2da341a9da0d58a1dbfad (patch)
tree52839177644fbec66a4b782392147cde76a36676
parent9b1998598625fb5b798e8291cafda1a8ec17c1bd (diff)
downloadop-kernel-dev-e84cc14213e2c81ae5a2da341a9da0d58a1dbfad.zip
op-kernel-dev-e84cc14213e2c81ae5a2da341a9da0d58a1dbfad.tar.gz
Btrfs: don't leak block group on error
In extent-tree.c:btrfs_write_dirty_block_groups(), if the call to write_one_cache_group() failed, we would return without putting the block group first. Signed-off-by: Filipe David Borba Manana <fdmanana@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 55b537f..54ee542 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3317,10 +3317,9 @@ again:
last = cache->key.objectid + cache->key.offset;
err = write_one_cache_group(trans, root, path, cache);
+ btrfs_put_block_group(cache);
if (err) /* File system offline */
goto out;
-
- btrfs_put_block_group(cache);
}
while (1) {
OpenPOWER on IntegriCloud