提交 e84cc142 编写于 作者: F Filipe David Borba Manana 提交者: 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: NFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
Signed-off-by: NChris Mason <chris.mason@fusionio.com>
上级 9b199859
...@@ -3317,10 +3317,9 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans, ...@@ -3317,10 +3317,9 @@ int btrfs_write_dirty_block_groups(struct btrfs_trans_handle *trans,
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册