Commit 7f2338bc authored by Jens Axboe's avatar Jens Axboe Committed by Akilesh Kailash
Browse files

UPSTREAM: mm/filemap: gate dropbehind invalidate on folio !dirty && !writeback



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().

Bug: 416315033
(cherry picked from commit 095f627a)
Cc: stable@vger.kernel.org
Reported-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Fixes: fb7d3bc4 ("mm/filemap: drop streaming/uncached pages when writeback completes")
Link: https://lore.kernel.org/linux-fsdevel/20250525083209.GS2023217@ZenIV/


Change-Id: I1d2e91a72b9b05620068ac26dc191b3ef33b205e
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Link: https://lore.kernel.org/20250527133255.452431-2-axboe@kernel.dk


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent 698d4907
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment