aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@gmail.com>2013-09-09 14:49:43 -0400
committerChris Mason <chris.mason@fusionio.com>2013-11-11 21:53:15 -0500
commite84cc14213e2c81ae5a2da341a9da0d58a1dbfad (patch)
tree52839177644fbec66a4b782392147cde76a36676 /fs/btrfs/extent-tree.c
parent9b1998598625fb5b798e8291cafda1a8ec17c1bd (diff)
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>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-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 55b537fcb81a..54ee542c705e 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -3317,10 +3317,9 @@ again:
3317 last = cache->key.objectid + cache->key.offset; 3317 last = cache->key.objectid + cache->key.offset;
3318 3318
3319 err = write_one_cache_group(trans, root, path, cache); 3319 err = write_one_cache_group(trans, root, path, cache);
3320 btrfs_put_block_group(cache);
3320 if (err) /* File system offline */ 3321 if (err) /* File system offline */
3321 goto out; 3322 goto out;
3322
3323 btrfs_put_block_group(cache);
3324 } 3323 }
3325 3324
3326 while (1) { 3325 while (1) {