From: Jan Kara Date: Thu, 26 Mar 2026 09:54:12 +0000 (+0100) Subject: ext2: Sync and invalidate metadata buffers from ext2_evict_inode() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4211dc89c31cb2a896a48de935e036775310380e;p=thirdparty%2Flinux.git ext2: Sync and invalidate metadata buffers from ext2_evict_inode() There are only very few filesystems using generic metadata buffer head tracking and everybody is paying the overhead. When we remove this tracking for inode reclaim code .evict will start to see inodes with metadata buffers attached so write them out and prune them. Signed-off-by: Jan Kara Link: https://patch.msgid.link/20260326095354.16340-60-jack@suse.cz Tested-by: syzbot@syzkaller.appspotmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index dbfe9098a1245..fb91c61aa6d6f 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -94,8 +94,9 @@ void ext2_evict_inode(struct inode * inode) if (inode->i_blocks) ext2_truncate_blocks(inode, 0); ext2_xattr_delete_inode(inode); + } else { + sync_mapping_buffers(&inode->i_data); } - invalidate_inode_buffers(inode); clear_inode(inode);