Commit 053800a8 authored by Kazuya Mio's avatar Kazuya Mio Committed by Jan Kara

ext3: Don't call dquot_free_block() if we don't update anything

dquot_free_block() is called in the end of ext3_new_blocks() and updates
information of the inode structure. However, this update is not necessary
if the number of blocks we requested is equal to the number of
allocated blocks.
Signed-off-by: default avatarKazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 75b09e02
...@@ -1743,8 +1743,11 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode, ...@@ -1743,8 +1743,11 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
*errp = 0; *errp = 0;
brelse(bitmap_bh); brelse(bitmap_bh);
if (num < *count) {
dquot_free_block(inode, *count-num); dquot_free_block(inode, *count-num);
*count = num; *count = num;
}
trace_ext3_allocate_blocks(inode, goal, num, trace_ext3_allocate_blocks(inode, goal, num,
(unsigned long long)ret_block); (unsigned long long)ret_block);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment