On Tue, May 27, 2025 at 07:28:52AM -0600, Jens Axboe wrote: > It's possible for the folio to either get marked for writeback or > redirtied. Add a helper, filemap_end_dropbehind(), which guards the > folio_unmap_invalidate() call behind check for the folio being both > non-dirty and not under writeback AFTER the folio lock has been > acquired. Use this helper folio_end_dropbehind_write(). Looks good: Reviewed-by: Christoph Hellwig <hch@xxxxxx>