fix some transaction issues
PATCH 1/1 fix some transaction issues
Hello,
There are a few places where we return without stopping the transaction we started. This patch fixes those places. Thank you,
Signed-off-by Josef Bacik <[email protected]>
extent-tree.c +3 -1
@@ -3103,8 +3103,10 @@ next: ret =btrfs_search_slot (trans, root, &key, path,-1 ,1 );if (ret >0 ) ret = -EIO ; -if (ret <0 ) +if (ret <0 ) { +btrfs_end_transaction (trans, root); goto out; + } clear_extent_bits(&info->block_group_cache, key.objectid, key.objectid + key.offset - 1,
inode.c +1 -1
@@ -2284,7 +2284,7 @@ static int btrfs_mkdir(struct inode *dir err =btrfs_find_free_objectid (trans, root, dir->i_ino, &objectid);if (err) { err = -ENOSPC ; - goto out_unlock; + goto out_fail; } inode = btrfs_new_inode(trans, root, dentry->d_name.name,
ioctl.c +4 -2
@@ -78,8 +78,10 @@ static noinline int create_subvol(struct leaf =btrfs_alloc_free_block (trans, root, root->leafsize, objectid, trans->transid,0 ,0 ,0 ,0 ); -if (IS_ERR (leaf)) -return PTR_ERR (leaf); +if (IS_ERR (leaf)) { + ret =PTR_ERR (leaf); + goto fail; + }btrfs_set_header_nritems (leaf,0 );btrfs_set_header_level (leaf,0 );