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.

exfat: use truncate_inode_pages_final() at evict_inode()

Currently, exfat uses truncate_inode_pages() in exfat_evict_inode().
However, truncate_inode_pages() does not mark the mapping as exiting,
so reclaim may still install shadow entries for the mapping until
the inode teardown completes.

In older kernels like Linux 5.10, if shadow entries are present
at that point,clear_inode() can hit

BUG_ON(inode->i_data.nrexceptional);

To align with VFS eviction semantics and prevent this situation,
switch to truncate_inode_pages_final() in ->evict_inode().

Other filesystems were updated to use truncate_inode_pages_final()
in ->evict_inode() by commit 91b0abe36a7b ("mm + fs: store shadow
entries in page cache")'.

Signed-off-by: Yang Wen <anmuxixixi@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>

authored by

Yang Wen and committed by
Namjae Jeon
4637b4cd 7dff99b3

+1 -1
+1 -1
fs/exfat/inode.c
··· 686 686 687 687 void exfat_evict_inode(struct inode *inode) 688 688 { 689 - truncate_inode_pages(&inode->i_data, 0); 689 + truncate_inode_pages_final(&inode->i_data); 690 690 691 691 if (!inode->i_nlink) { 692 692 i_size_write(inode, 0);