Skip to content

Commit 0f475ee

Browse files
fdmananakdave
authored andcommitted
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: dd5f961 ("Btrfs: maintain subvolume items in the UUID tree") CC: [email protected] # 3.12+ Reviewed-by: Anand Jain <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 87f2c46 commit 0f475ee

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/btrfs/ioctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,8 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
39843984

39853985
ret = btrfs_update_root(trans, fs_info->tree_root,
39863986
&root->root_key, &root->root_item);
3987-
if (ret < 0) {
3987+
if (unlikely(ret < 0)) {
3988+
btrfs_abort_transaction(trans, ret);
39883989
btrfs_end_transaction(trans);
39893990
goto out;
39903991
}

0 commit comments

Comments
 (0)