Re: [PATCH v2 22/35] mm/hugetlb: serialize private faults with truncation
From: David Carlier
Date: Fri Dec 04 2026 - 12:33:22 EST
Hi David,
What about the case where a page cache folio already exists? For a write
fault in a MAP_PRIVATE VMA, hugetlb_no_page() maps it and calls
hugetlb_wp() without the invalidate lock or an EOF recheck. If truncation
runs after the lookup, the folio is found unmapped afterwards and the anon
copy stays mapped beyond EOF.
Taking the invalidate lock before filemap_lock_hugetlb_folio() for private
mappings would cover it, what do you think?
Cheers