The "first" should be used to compare with COMPOUND_MAPPED instead of "nr". Signed-off-by: Yin Fengwei <fengwei.yin@xxxxxxxxx> --- mm/rmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/rmap.c b/mm/rmap.c index ec52d7f264aa..b352c14da16c 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1330,7 +1330,7 @@ void folio_add_file_rmap_range(struct folio *folio, struct page *page, first = atomic_inc_and_test(&page->_mapcount); if (first && folio_test_large(folio)) { first = atomic_inc_return_relaxed(mapped); - first = (nr < COMPOUND_MAPPED); + first = (first < COMPOUND_MAPPED); } if (first) -- 2.30.2