Btrfs: disable qgroup id 0
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 15 Nov 2012 11:35:41 +0000 (11:35 +0000)
committerJosef Bacik <josef@toxicpanda.com>
Mon, 14 Jan 2013 18:52:31 +0000 (13:52 -0500)
Qgroup id 0 is a special number, we should set the id of a qgroup to 0.
Fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
fs/btrfs/ioctl.c

index 7624212ae92600fbebc72bb58ba79b4af9a99309..dd8e3448fe8fafaebc315df5032d897be975c3fb 100644 (file)
@@ -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);