quota: manage reserved space when quota is not active [v2]
commit97068a372bcb543d824f330808d0a20ffed85d91
authorDmitry Monakhov <dmonakhov@openvz.org>
Tue, 9 Feb 2010 16:53:36 +0000 (9 17:53 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:58:53 +0000 (1 15:58 -0700)
treea9bd3ace7364f50b9f073f7e7a01314d2b5782dd
parent78164a9748e276563ec008ed916720d8a90db86b
quota: manage reserved space when quota is not active [v2]

commit c469070aea5a0ada45a836937c776fd3083dae2b upstream.

Since we implemented generic reserved space management interface,
then it is possible to account reserved space even when quota
is not active (similar to i_blocks/i_bytes).

Without this patch following testcase result in massive comlain from
WARN_ON in dquot_claim_space()

TEST_CASE:
mount /dev/sdb /mnt -oquota
dd if=/dev/zero of=/mnt/test bs=1M count=1
quotaon /mnt
# fs_reserved_spave == 1Mb
# quota_reserved_space == 0, because quota was disabled
dd if=/dev/zero of=/mnt/test seek=1 bs=1M count=1
# fs_reserved_spave == 2Mb
# quota_reserved_space == 1Mb
sync  # ->dquot_claim_space() -> WARN_ON

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/quota/dquot.c
include/linux/quotaops.h