Commit 36a3b14b authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

vmscan: check folio_test_private(), not folio_get_private()

These two predicates are the same for file pages, but are not the same for
anonymous pages.

Link: https://lkml.kernel.org/r/20220902192639.1737108-3-willy@infradead.org
Fixes: 07f67a8d ("mm/vmscan: convert shrink_active_list() to use a folio")
Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Reported-by: default avatarHugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent b9eb7776
......@@ -2550,8 +2550,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
}
if (unlikely(buffer_heads_over_limit)) {
if (folio_get_private(folio) && folio_trylock(folio)) {
if (folio_get_private(folio))
if (folio_test_private(folio) && folio_trylock(folio)) {
if (folio_test_private(folio))
filemap_release_folio(folio, 0);
folio_unlock(folio);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment