diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-11-15 06:35:41 -0500 |
---|---|---|
committer | Josef Bacik <josef@toxicpanda.com> | 2013-01-14 13:52:31 -0500 |
commit | d86e56cf7d3669dd292012ac82b986bd1573b6cc (patch) | |
tree | 60995d977a3143b8ca0d771db80606163f6a72f7 /fs/btrfs | |
parent | cc975eb4605c5765a5d5e7a51d24ba5a1cda269e (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-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) | |||
3698 | goto drop_write; | 3698 | goto drop_write; |
3699 | } | 3699 | } |
3700 | 3700 | ||
3701 | if (!sa->qgroupid) { | ||
3702 | ret = -EINVAL; | ||
3703 | goto out; | ||
3704 | } | ||
3705 | |||
3701 | trans = btrfs_join_transaction(root); | 3706 | trans = btrfs_join_transaction(root); |
3702 | if (IS_ERR(trans)) { | 3707 | if (IS_ERR(trans)) { |
3703 | ret = PTR_ERR(trans); | 3708 | ret = PTR_ERR(trans); |