Re: [RFC PATCH] mm: filemap: fix nr_pages calculation overflow in filemap_map_pages()
From: David Hildenbrand (Arm)
Date: Tue Mar 17 2026 - 04:31:44 EST
>> LGTM. I do wonder if we want to add a comment above the file_end,
>> stating that this really must happen before the next_uptodate_folio()
>> to handle concurrent truncation.
>
> Ack. How about adding the following comments?
>
> "
> Recalculate end_pgoff based on file_end before calling
> next_uptodate_folio() to avoid races with concurrent truncation.
> "
Works for me, thanks!
--
Cheers,
David