Re: [PATCH v3] ext4: unmap invalidated folios from page tables in mpage_release_unused_pages()

From: Theodore Ts'o

Date: Fri Apr 10 2026 - 11:32:52 EST



On Fri, 05 Dec 2025 11:29:14 +0530, Deepanshu Kartikey wrote:
> When delayed block allocation fails (e.g., due to filesystem corruption
> detected in ext4_map_blocks()), the writeback error handler calls
> mpage_release_unused_pages(invalidate=true) which invalidates affected
> folios by clearing their uptodate flag via folio_clear_uptodate().
>
> However, these folios may still be mapped in process page tables. If a
> subsequent operation (such as ftruncate calling ext4_block_truncate_page)
> triggers a write fault, the existing page table entry allows access to
> the now-invalidated folio. This leads to ext4_page_mkwrite() being called
> with a non-uptodate folio, which then gets marked dirty, triggering:
>
> [...]

Applied, thanks!

[1/1] ext4: unmap invalidated folios from page tables in mpage_release_unused_pages()
commit: 9b25f381de6b8942645f43735cb0a4fb0ab3a6d1

Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>