|
@@ -4270,18 +4270,17 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
|
|
* again is not run concurrently.
|
|
* again is not run concurrently.
|
|
*/
|
|
*/
|
|
spin_lock(&dest->root_item_lock);
|
|
spin_lock(&dest->root_item_lock);
|
|
- root_flags = btrfs_root_flags(&dest->root_item);
|
|
|
|
- if (dest->send_in_progress == 0) {
|
|
|
|
- btrfs_set_root_flags(&dest->root_item,
|
|
|
|
- root_flags | BTRFS_ROOT_SUBVOL_DEAD);
|
|
|
|
- spin_unlock(&dest->root_item_lock);
|
|
|
|
- } else {
|
|
|
|
|
|
+ if (dest->send_in_progress) {
|
|
spin_unlock(&dest->root_item_lock);
|
|
spin_unlock(&dest->root_item_lock);
|
|
btrfs_warn(fs_info,
|
|
btrfs_warn(fs_info,
|
|
"attempt to delete subvolume %llu during send",
|
|
"attempt to delete subvolume %llu during send",
|
|
dest->root_key.objectid);
|
|
dest->root_key.objectid);
|
|
return -EPERM;
|
|
return -EPERM;
|
|
}
|
|
}
|
|
|
|
+ root_flags = btrfs_root_flags(&dest->root_item);
|
|
|
|
+ btrfs_set_root_flags(&dest->root_item,
|
|
|
|
+ root_flags | BTRFS_ROOT_SUBVOL_DEAD);
|
|
|
|
+ spin_unlock(&dest->root_item_lock);
|
|
|
|
|
|
down_write(&fs_info->subvol_sem);
|
|
down_write(&fs_info->subvol_sem);
|
|
|
|
|