Commit c7e54b51 authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: abort transaction after failed inode updates in create_subvol

We can just abort the transaction here, and in fact do that for every
other failure in this function except these two cases.

CC: # 4.4+
Reviewed-by: default avatarFilipe Manana <>
Reviewed-by: default avatarJohannes Thumshirn <>
Signed-off-by: default avatarJosef Bacik <>
Reviewed-by: default avatarDavid Sterba <>
Signed-off-by: default avatarDavid Sterba <>
parent 147271e3
......@@ -704,11 +704,17 @@ static noinline int create_subvol(struct inode *dir,
btrfs_i_size_write(BTRFS_I(dir), dir->i_size + namelen * 2);
ret = btrfs_update_inode(trans, root, dir);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto fail;
ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid,
btrfs_ino(BTRFS_I(dir)), index, name, namelen);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto fail;
ret = btrfs_uuid_tree_add(trans, root_item->uuid,
Supports Markdown
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