[PATCH] ntfs3: sync uptodate with iomap folio state in read_folio
From: Adarsh Das
Date: Mon Sep 21 2026 - 14:40:32 EST
ntfs3 registers iomap page-cache helpers for its regular files. When
the filesystem block size is smaller than the folio size, folios are
backed by iomap_folio_state with a per-block uptodate bitmap in addition
to PG_uptodate.
The i_valid <= vbo early exit in ntfs_read_folio() zeroes folios past
valid data and marks them uptodate with folio_mark_uptodate(), updating
only the folio flag. That leaves the iomap bitmap out of sync and
ifs_free() WARNs during evict when the folio is torn down.
Use iomap_folio_mark_uptodate() to update both the folio uptodate state
and the iomap uptodate bitmap.
Reported-by: syzbot+3db654d91b471c4d7a7d@xxxxxxxxxxxxxxxxxxxxxxxxx
Link: https://lore.kernel.org/all/6aab8055.71f81b7d.278072.0016.GAE@xxxxxxxxxx/
Tested-by: syzbot+3db654d91b471c4d7a7d@xxxxxxxxxxxxxxxxxxxxxxxxx
Assisted-by: LLM
Signed-off-by: Adarsh Das <adarshdas950@xxxxxxxxx>
---
fs/ntfs3/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 56b4f6469a28..a9b4e288ca20 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -842,7 +842,7 @@ static int ntfs_read_folio(struct file *file, struct folio *folio)
if (ni->i_valid <= vbo) {
folio_zero_range(folio, 0, folio_size(folio));
- folio_mark_uptodate(folio);
+ iomap_folio_mark_uptodate(folio);
folio_unlock(folio);
return 0;
}
--
2.55.0