From: Kefeng Wang Date: Wed, 8 Mar 2023 08:33:11 +0000 (+0800) Subject: mm/damon/paddr: fix missing folio_sz update in damon_pa_young() X-Git-Tag: microblaze-v6.6~533^2~5 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=70307b0e297a6634be855c49525ccbea50922a90;p=linux-2.6-microblaze.git mm/damon/paddr: fix missing folio_sz update in damon_pa_young() The *folio_sz in damon_pa_young() will be used(as last_folio_sz) by __damon_pa_check_access(), so it's need to be updated, fix missing branch. Link: https://lkml.kernel.org/r/20230308083311.120951-4-wangkefeng.wang@huawei.com Signed-off-by: Kefeng Wang Reviewed-by: SeongJae Park Signed-off-by: Andrew Morton --- diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index b22f6fbb5816..467b99166b43 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -134,10 +134,8 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz) } need_lock = !folio_test_anon(folio) || folio_test_ksm(folio); - if (need_lock && !folio_trylock(folio)) { - folio_put(folio); - return false; - } + if (need_lock && !folio_trylock(folio)) + goto out; rmap_walk(folio, &rwc);