Skip to content

Commit 0c309d6

Browse files
boryaskdave
authored andcommitted
btrfs: forbid creating subvol qgroups
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: cecbb53 ("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]>
1 parent f884a9f commit 0c309d6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/btrfs/ioctl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3806,6 +3806,11 @@ static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg)
38063806
goto out;
38073807
}
38083808

3809+
if (sa->create && is_fstree(sa->qgroupid)) {
3810+
ret = -EINVAL;
3811+
goto out;
3812+
}
3813+
38093814
trans = btrfs_join_transaction(root);
38103815
if (IS_ERR(trans)) {
38113816
ret = PTR_ERR(trans);

0 commit comments

Comments
 (0)