* [PATCH] Subject: [PATCH] exfat: use truncate_inode_pages_final() at evict_inode()
@ 2026-02-25 14:59 Yang Wen
2026-02-26 9:35 ` Namjae Jeon
0 siblings, 1 reply; 2+ messages in thread
From: Yang Wen @ 2026-02-25 14:59 UTC (permalink / raw)
To: linkinjeon, sj1557.seo; +Cc: yuezhang.mo, linux-fsdevel, linux-kernel, Yang Wen
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>
---
fs/exfat/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/exfat/inode.c b/fs/exfat/inode.c
index 2fb2d2d5d503..567308aff726 100644
--- a/fs/exfat/inode.c
+++ b/fs/exfat/inode.c
@@ -686,7 +686,7 @@ struct inode *exfat_build_inode(struct super_block *sb,
void exfat_evict_inode(struct inode *inode)
{
- truncate_inode_pages(&inode->i_data, 0);
+ truncate_inode_pages_final(&inode->i_data);
if (!inode->i_nlink) {
i_size_write(inode, 0);
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Subject: [PATCH] exfat: use truncate_inode_pages_final() at evict_inode()
2026-02-25 14:59 [PATCH] Subject: [PATCH] exfat: use truncate_inode_pages_final() at evict_inode() Yang Wen
@ 2026-02-26 9:35 ` Namjae Jeon
0 siblings, 0 replies; 2+ messages in thread
From: Namjae Jeon @ 2026-02-26 9:35 UTC (permalink / raw)
To: Yang Wen; +Cc: sj1557.seo, yuezhang.mo, linux-fsdevel, linux-kernel
On Wed, Feb 25, 2026 at 11:59 PM Yang Wen <anmuxixixi@gmail.com> wrote:
>
> 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>
Applied it to #dev.
Thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-02-26 9:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-25 14:59 [PATCH] Subject: [PATCH] exfat: use truncate_inode_pages_final() at evict_inode() Yang Wen
2026-02-26 9:35 ` Namjae Jeon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®