[PATCH 1/9] mm: Fix missing folio invalidation calls during truncation

Matthew Wilcox willy at infradead.org
Sat Aug 24 06:12:41 AEST 2024


On Fri, Aug 23, 2024 at 09:08:09PM +0100, David Howells wrote:
> When AS_RELEASE_ALWAYS is set on a mapping, the ->release_folio() and
> ->invalidate_folio() calls should be invoked even if PG_private and
> PG_private_2 aren't set.  This is used by netfslib to keep track of the
> point above which reads can be skipped in favour of just zeroing pagecache
> locally.
> 
> There are a couple of places in truncation in which invalidation is only
> called when folio_has_private() is true.  Fix these to check
> folio_needs_release() instead.

Reviewed-by: Matthew Wilcox (Oracle) <willy at infradead.org>

I think we also want to change the folio_has_private() call in
mapping_evict_folio() to folio_test_private().  Same for the one
in migrate_vma_check_page().


More information about the Linux-erofs mailing list