]> www.infradead.org Git - users/willy/pagecache.git/commit
btrfs: skip inodes without loaded extent maps when shrinking extent maps
authorFilipe Manana <fdmanana@suse.com>
Sat, 15 Feb 2025 11:04:15 +0000 (11:04 +0000)
committerDavid Sterba <dsterba@suse.com>
Fri, 21 Feb 2025 08:32:07 +0000 (09:32 +0100)
commitc6c9c4d56483d941f567eb921434c25fc6086dfa
tree4bab4bc4c6182f29e2075e1cd0e34aff382b6987
parent59f37036bb7ab3d554c24abc856aabca01126414
btrfs: skip inodes without loaded extent maps when shrinking extent maps

If there are inodes that don't have any loaded extent maps, we end up
grabbing a reference on them and later adding a delayed iput, which wakes
up the cleaner and makes it do unnecessary work. This is common when for
example the inodes were open only to run stat(2) or all their extent maps
were already released through the folio release callback
(btrfs_release_folio()) or released by a previous run of the shrinker, or
directories which never have extent maps.

Reported-by: Ivan Shapovalov <intelfx@intelfx.name>
Tested-by: Ivan Shapovalov <intelfx@intelfx.name>
Link: https://lore.kernel.org/linux-btrfs/0414d690ac5680d0d77dfc930606cdc36e42e12f.camel@intelfx.name/
CC: stable@vger.kernel.org # 6.13+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_map.c