diff mbox

Btrfs: fix overhead check for qgroupid in the kernel

Message ID 1361802632-2491-1-git-send-email-wangshilong1991@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang Shilong Feb. 25, 2013, 2:30 p.m. UTC
From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>

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.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
---
 fs/btrfs/ioctl.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Blair Zajac Feb. 25, 2013, 5:38 p.m. UTC | #1
On 02/25/2013 06:30 AM, Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
>
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 059546a..8a31a04 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -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);