btrfs: remove i_size restriction at try_release_extent_mapping()
authorFilipe Manana <fdmanana@suse.com>
Tue, 16 Apr 2024 14:19:03 +0000 (15:19 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:07 +0000 (21:31 +0200)
commit433a3e01dda1d463159a9620b40ba027514f0ea5
treee68d1b7d900c5191b1de5d1b6fc8ff1a3c5f76fb
parent85d288309ab5463140a2d00b3827262fb14e7db4
btrfs: remove i_size restriction at try_release_extent_mapping()

Currently we don't attempt to release extent maps if the inode has an
i_size that is not greater than 16M. This condition was added way back
in 2008 by commit 70dec8079d78 ("Btrfs: extent_io and extent_state
optimizations"), without any explanation about it. A quick chat with
Chris on slack revealed that the goal was probably to release the extent
maps for small files only when closing the inode. This however can be
harmful in case we have tons of such files being kept open for very long
periods of time, since we will consume more and more pages for extent
maps.

So remove the condition.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c