Skip to content

Commit e84cc14

Browse files
fdmananaChris Mason
authored andcommitted
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>
1 parent 9b19985 commit e84cc14

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/btrfs/extent-tree.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,10 +3317,9 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
33173317
last = cache->key.objectid + cache->key.offset;
33183318

33193319
err = write_one_cache_group(trans, root, path, cache);
3320+
btrfs_put_block_group(cache);
33203321
if (err) /* File system offline */
33213322
goto out;
3322-
3323-
btrfs_put_block_group(cache);
33243323
}
33253324

33263325
while (1) {

0 commit comments

Comments
 (0)