ext4: fix quota accounting in case of fallocate
authorDmitry Monakhov <dmonakhov@openvz.org>
Sun, 16 May 2010 04:00:00 +0000 (00:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
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 81d605412844895c4386c92c0f4920db39acbd94..55bfcd94d1ab6a396cd343bf836910a7704f5f75 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);
        }
 
        /*