quota: Fix warning when a delayed write happens before quota is enabled
authorJan Kara <jack@suse.cz>
Tue, 9 Feb 2010 17:20:39 +0000 (18:20 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 23:02:12 +0000 (16:02 -0700)
commite58bb78fcd092688765b18574ea4055c2509aee5
tree7c8cb63e9288239024652660d3295e605f75f69e
parent1f371c1a285e3dab9c6951cb9f4410c17bcb6ba1
quota: Fix warning when a delayed write happens before quota is enabled

commit 0a5a9c725512461d19397490f3adf29931dca1f2 upstream.

If a delayed-allocation write happens before quota is enabled, the
kernel spits out a warning:
WARNING: at fs/quota/dquot.c:988 dquot_claim_space+0x77/0x112()

because the fact that user has some delayed allocation is not recorded
in quota structure.

Make dquot_initialize() update amount of reserved space for user if it sees
inode has some space reserved. Also make sure that reserved quota space does
not go negative and we warn about the filesystem bug just once.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/quota/dquot.c