ext4: fix quota accounting in case of fallocate
Dmitry Monakhov [Sun, 16 May 2010 04:00:00 +0000 (00:00 -0400)]
allocated_meta_data is already included in 'used' variable.

Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

fs/ext4/inode.c

index 81d6054..55bfcd9 100644 (file)
@@ -1126,7 +1126,8 @@ void ext4_da_update_reserve_space(struct inode *inode,
                 */
                if (allocated_meta_blocks)
                        dquot_claim_block(inode, allocated_meta_blocks);
-               dquot_release_reservation_block(inode, mdb_free + used);
+               dquot_release_reservation_block(inode, mdb_free + used -
+                                               allocated_meta_blocks);
        }
 
        /*