From: Miao Xie Date: Thu, 15 Nov 2012 11:35:41 +0000 (+0000) Subject: Btrfs: disable qgroup id 0 X-Git-Tag: v3.8-rc5~1^2~10^2~11 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=d86e56cf7d3669dd292012ac82b986bd1573b6cc;p=linux-block.git Btrfs: disable qgroup id 0 Qgroup id 0 is a special number, we should set the id of a qgroup to 0. Fix it. Signed-off-by: Miao Xie --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7624212ae926..dd8e3448fe8f 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3698,6 +3698,11 @@ 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);