]> Git Repo - linux.git/commitdiff
btrfs: forbid creating subvol qgroups
authorBoris Burkov <[email protected]>
Thu, 11 Jan 2024 01:51:26 +0000 (17:51 -0800)
committerDavid Sterba <[email protected]>
Wed, 31 Jan 2024 07:42:44 +0000 (08:42 +0100)
Creating a qgroup 0/subvolid leads to various races and it isn't
helpful, because you can't specify a subvol id when creating a subvol,
so you can't be sure it will be the right one. Any requirements on the
automatic subvol can be gratified by using a higher level qgroup and the
inheritance parameters of subvol creation.

Fixes: cecbb533b5fc ("btrfs: record simple quota deltas in delayed refs")
CC: [email protected] # 4.14+
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Boris Burkov <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
fs/btrfs/ioctl.c

index 5d42319b43f2ddea959f56e23dff8be5eb907ae0..fb2323b323bf900c8e86dfae8dae4733f7f97cb3 100644 (file)
@@ -3806,6 +3806,11 @@ static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
                goto out;
        }
 
+       if (sa->create && is_fstree(sa->qgroupid)) {
+               ret = -EINVAL;
+               goto out;
+       }
+
        trans = btrfs_join_transaction(root);
        if (IS_ERR(trans)) {
                ret = PTR_ERR(trans);
This page took 0.059608 seconds and 4 git commands to generate.