btrfs: Check qgroup level in kernel qgroup assign.
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Fri, 27 Feb 2015 08:24:22 +0000 (16:24 +0800)
committerChris Mason <clm@fb.com>
Mon, 13 Apr 2015 14:52:53 +0000 (07:52 -0700)
commit8465ecec9611d60cbbc8e374ecf68453e0dd5b50
treeeae55fdac84734729dfbfa6488ec76b6d322199c
parentf5a6b1c53bdd44f79e3904c0f5e59f956b49b2c8
btrfs: Check qgroup level in kernel qgroup assign.

Although we have qgroup level check in btrfs-progs, it's not enough
since other programe may still call ioctl directly not using
btrfs-progs. For example, systemd.

But it's btrfs-progs to be blame since we don't provide a
full-function(like subvolume create things) btrfs library with enough
check, and only rely on kernel ioctl.

So Add level checks in kernel too.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ctree.h
fs/btrfs/qgroup.c