Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Kazuya Mio and committed by
Jan Kara
053800a8 75b09e02

+5 -2
+5 -2
fs/ext3/balloc.c
··· 1743 1743 1744 1744 *errp = 0; 1745 1745 brelse(bitmap_bh); 1746 - dquot_free_block(inode, *count-num); 1747 - *count = num; 1746 + 1747 + if (num < *count) { 1748 + dquot_free_block(inode, *count-num); 1749 + *count = num; 1750 + } 1748 1751 1749 1752 trace_ext3_allocate_blocks(inode, goal, num, 1750 1753 (unsigned long long)ret_block);