From: Jan Kara Date: Thu, 26 Mar 2026 09:54:14 +0000 (+0100) Subject: bfs: Sync and invalidate metadata buffers from bfs_evict_inode() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a7fd1823efc39eb94022a068394c7063764fea8;p=thirdparty%2Fkernel%2Flinux.git bfs: Sync and invalidate metadata buffers from bfs_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-62-jack@suse.cz Tested-by: syzbot@syzkaller.appspotmail.com Signed-off-by: Christian Brauner --- diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 9da02f5cb6cd..e0e50a9dbe9c 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -187,6 +187,8 @@ static void bfs_evict_inode(struct inode *inode) dprintf("ino=%08lx\n", ino); truncate_inode_pages_final(&inode->i_data); + if (inode->i_nlink) + sync_mapping_buffers(&inode->i_data); invalidate_inode_buffers(inode); clear_inode(inode);