This patchset introduces a mutex lock 'qgroup_ioctl_lock' to protect all the user change for quota operations. Without an extra lock, race condition can not be avoided between operations in disk and in memory. Holding mutex lock, we can fix missing check before creating a qgroup(whether 'src' and 'dst' exist).And we can guarantee that all the qgroups in 'inherit' dose exist before tracking qgroup. V2->V3: rename 'quota_lock' to 'qgroup_ioctl_lock' and holding 'qgroup_ioctl_lock' inside qgroup.c to avoid serializing operations. V1->V2: use quota configurations in memory to speed up checks. Wang Shilong (5): Btrfs: introduce a mutex lock for btrfs quota operations Btrfs: remove some unnecessary spin_lock usages Btrfs: fix missing check before creating a qgroup relation Btrfs: fix missing check in the btrfs_qgroup_inherit() Btrfs: fix a warning when updating qgroup limit fs/btrfs/ctree.h | 3 ++ fs/btrfs/disk-io.c | 1 + fs/btrfs/qgroup.c | 136 ++++++++++++++++++++++++++++++++++------------------- 3 files changed, 92 insertions(+), 48 deletions(-) -- 1.7.11.7 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
