|
@@ -1827,8 +1827,13 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file,
|
|
|
|
|
|
ret = btrfs_update_root(trans, fs_info->tree_root,
|
|
ret = btrfs_update_root(trans, fs_info->tree_root,
|
|
&root->root_key, &root->root_item);
|
|
&root->root_key, &root->root_item);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ btrfs_end_transaction(trans);
|
|
|
|
+ goto out_reset;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ret = btrfs_commit_transaction(trans);
|
|
|
|
|
|
- btrfs_commit_transaction(trans);
|
|
|
|
out_reset:
|
|
out_reset:
|
|
if (ret)
|
|
if (ret)
|
|
btrfs_set_root_flags(&root->root_item, root_flags);
|
|
btrfs_set_root_flags(&root->root_item, root_flags);
|