Commit e84cc142 authored by Filipe David Borba Manana's avatar Filipe David Borba Manana Committed by Chris Mason

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: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 9b199859
......@@ -3317,10 +3317,9 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment