Commit 8e8a1e31 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: Fix a few functions that exit without stopping their transaction

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 7b128766
...@@ -3275,8 +3275,10 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start) ...@@ -3275,8 +3275,10 @@ int btrfs_shrink_extent_tree(struct btrfs_root *root, u64 shrink_start)
ret = btrfs_search_slot(trans, root, &key, path, -1, 1); ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret > 0) if (ret > 0)
ret = -EIO; ret = -EIO;
if (ret < 0) if (ret < 0) {
btrfs_end_transaction(trans, root);
goto out; goto out;
}
clear_extent_bits(&info->block_group_cache, key.objectid, clear_extent_bits(&info->block_group_cache, key.objectid,
key.objectid + key.offset - 1, key.objectid + key.offset - 1,
......
...@@ -78,8 +78,10 @@ static noinline int create_subvol(struct btrfs_root *root, char *name, ...@@ -78,8 +78,10 @@ static noinline int create_subvol(struct btrfs_root *root, char *name,
leaf = btrfs_alloc_free_block(trans, root, root->leafsize, leaf = btrfs_alloc_free_block(trans, root, root->leafsize,
objectid, trans->transid, 0, 0, objectid, trans->transid, 0, 0,
0, 0); 0, 0);
if (IS_ERR(leaf)) if (IS_ERR(leaf)) {
return PTR_ERR(leaf); ret = PTR_ERR(leaf);
goto fail;
}
btrfs_set_header_nritems(leaf, 0); btrfs_set_header_nritems(leaf, 0);
btrfs_set_header_level(leaf, 0); btrfs_set_header_level(leaf, 0);
......
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