Btrfs: fix overhead check for qgroupid in the kernel
PATCH 1/1 Btrfs: fix overhead check for qgroupid in the kernel
From: Wang Shilong <[email protected]>
As we implement the strict hierarchy quota in the userspace, it is sufficient to check this ruler in the userspace.remove the special check for qgroup 0.
--- fs/btrfs/ioctl.c | 5 ----- 1 file changed, 5 deletions(-)
fs/btrfs/ioctl.c +0 -5
@@ -3764,11 +3764,6 @@ static long btrfs_ioctl_qgroup_create(struct file *file, void __user *arg) goto drop_write; } -if (!sa->qgroupid) { - ret = -EINVAL ; - goto out; - } - trans =btrfs_join_transaction (root);if (IS_ERR (trans)) { ret =PTR_ERR (trans);
Signature · 1 line
1.7.11.7
Quoted 5 lines · Wang Shilong
From: Wang Shilong <[email protected]>
As we implement the strict hierarchy quota in the userspace, it is sufficient to check this ruler in the userspace.remove the special check for qgroup 0.
I haven't done any kernel coding so I'm curious, but is this a safe change? When I code, I always have the authoritative code do a check, e.g. in web programing, the browser can do data validation but you always have the web server check incoming data also, so it doesn't hurt to have it in the kernel itself.
The other thing is that it is possible for people and distributions to upgrade the kernel without upgrading the btrfs tools, so there could be a window when there is no check on somebody's system.
Regards,
Blair