Commit 0f475ee0 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: abort transaction on failure to update root in the received subvol ioctl



If we failed to update the root we don't abort the transaction, which is
wrong since we already used the transaction to remove an item from the
uuid tree.

Fixes: dd5f9615 ("Btrfs: maintain subvolume items in the UUID tree")
CC: stable@vger.kernel.org # 3.12+
Reviewed-by: default avatarAnand Jain <asj@kernel.org>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 87f2c460
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3984,7 +3984,8 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,

	ret = btrfs_update_root(trans, fs_info->tree_root,
				&root->root_key, &root->root_item);
	if (ret < 0) {
	if (unlikely(ret < 0)) {
		btrfs_abort_transaction(trans, ret);
		btrfs_end_transaction(trans);
		goto out;
	}