Btrfs: fix missing check before creating a qgroup relation
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>
Sun, 7 Apr 2013 10:50:18 +0000 (10:50 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:39 +0000 (15:54 -0400)
commitb7fef4f593007d52ba7fe4427e099bd71c63c521
tree44a7d1bf7d8bb70cd125e435082c1244466e2e0e
parent58400fce5ac5939aadac8ce682edc192c6172f80
Btrfs: fix missing check before creating a qgroup relation

Step to reproduce:
mkfs.btrfs <disk>
mount <disk> <mnt>
btrfs quota enable <mnt>
btrfs qgroup assign 0/1 1/1 <mnt>
umount <mnt>
btrfs-debug-tree <disk> | grep QGROUP
If we want to add a qgroup relation, we should gurantee that
'src' and 'dst' exist, otherwise, such qgroup relation should
not be allowed to create.

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
fs/btrfs/qgroup.c