[PATCH 18/41] bfs: Sync and invalidate metadata buffers from bfs_evict_inode()

Jan Kara
2026-03-20T13:42:45Z

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 <jack@suse.cz>
---
fs/bfs/inode.c | 2 ++
1 file changed, 2 insertions(+)

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);

--
2.51.0