diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-11-15 12:35:41 +0100 |
---|---|---|
committer | Josef Bacik <josef@toxicpanda.com> | 2013-01-14 19:52:31 +0100 |
commit | d86e56cf7d3669dd292012ac82b986bd1573b6cc (patch) | |
tree | 60995d977a3143b8ca0d771db80606163f6a72f7 | |
parent | btrfs: get the device in write mode when deleting it (diff) | |
download | linux-d86e56cf7d3669dd292012ac82b986bd1573b6cc.tar.xz linux-d86e56cf7d3669dd292012ac82b986bd1573b6cc.zip |
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 <miaox@cn.fujitsu.com>
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |