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>
This commit is contained in:
committed by
Chris Mason
parent
9b19985986
commit
e84cc14213
@@ -3317,10 +3317,9 @@ again:
|
|||||||
last = cache->key.objectid + cache->key.offset;
|
last = cache->key.objectid + cache->key.offset;
|
||||||
|
|
||||||
err = write_one_cache_group(trans, root, path, cache);
|
err = write_one_cache_group(trans, root, path, cache);
|
||||||
|
btrfs_put_block_group(cache);
|
||||||
if (err) /* File system offline */
|
if (err) /* File system offline */
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
btrfs_put_block_group(cache);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Reference in New Issue
Block a user