]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: add all ioctl checks before user change for quota operations
authorWang Shilong <wangsl-fnst@cn.fujitsu.com>
Wed, 17 Apr 2013 14:49:51 +0000 (14:49 +0000)
committerJosef Bacik <jbacik@fusionio.com>
Mon, 6 May 2013 19:54:59 +0000 (15:54 -0400)
commitaff86028a0c66a39b766c450824fa38742ffe824
tree1f699427735afa1fa7ceb77863697703e434459f
parent8786a86f64dfaf9570fbff0c7684fbc3d1d0cabe
Btrfs: add all ioctl checks before user change for quota operations

Since all the quota configurations are loaded in memory, and we can
have ioctl checks before operating in the disk. It is safe to do such
things because qgroup_ioctl_lock is held outside.

Without these extra checks firstly, it should be ok to do user change
for quota operations. For example:

if we want to add an existed qgroup, we will do:
->add_qgroup_item()
->add_qgroup_rb()

add_qgroup_item() will return -EEXIST to us, however, qgroups are all
in memory, why not check them in memory firstly.

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