Skip to content

Commit

Permalink
Btrfs: disable qgroup id 0
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miao Xie authored and Josef Bacik committed Jan 14, 2013
1 parent cc975eb commit d86e56c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d86e56c

Please sign in to comment.