Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ext4: Sync and invalidate metadata buffers from ext4_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.

Acked-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20260326095354.16340-61-jack@suse.cz
Tested-by: syzbot@syzkaller.appspotmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jan Kara and committed by
Christian Brauner
77ff1ff2 4211dc89

+5 -2
+3 -1
fs/ext4/inode.c
··· 185 185 ext4_evict_ea_inode(inode); 186 186 if (inode->i_nlink) { 187 187 truncate_inode_pages_final(&inode->i_data); 188 - 188 + /* Avoid mballoc special inode which has no proper iops */ 189 + if (!EXT4_SB(inode->i_sb)->s_journal) 190 + sync_mapping_buffers(&inode->i_data); 189 191 goto no_delete; 190 192 } 191 193
+2 -1
fs/ext4/super.c
··· 1524 1524 void ext4_clear_inode(struct inode *inode) 1525 1525 { 1526 1526 ext4_fc_del(inode); 1527 - invalidate_inode_buffers(inode); 1527 + if (!EXT4_SB(inode->i_sb)->s_journal) 1528 + invalidate_inode_buffers(inode); 1528 1529 clear_inode(inode); 1529 1530 ext4_discard_preallocations(inode); 1530 1531 ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS);