summaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 21:26:39 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-09-12 01:22:31 +0200
commit36a3b14b5febdaf0e7f70c4ca6f62c8ea75fabfe (patch)
tree435005045bb6c67fb9cb1bb4deb8b33a9672ecd7 /mm/vmscan.c
parentmm: fix VM_BUG_ON in __delete_from_swap_cache() (diff)
downloadlinux-36a3b14b5febdaf0e7f70c4ca6f62c8ea75fabfe.tar.xz
linux-36a3b14b5febdaf0e7f70c4ca6f62c8ea75fabfe.zip
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: 07f67a8dedc0 ("mm/vmscan: convert shrink_active_list() to use a folio") Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reported-by: Hugh Dickins <hughd@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index b2b1431352dc..382dbe97329f 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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);
}