[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <90d30f18-68e7-d295-7a42-c33554fd8b17@huawei.com>
Date: Mon, 6 Mar 2023 10:09:16 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: SeongJae Park <sj@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
CC: <damon@...ts.linux.dev>, <linux-mm@...ck.org>,
<linux-kernel@...r.kernel.org>, <stable@...r.kernel.org>
Subject: Re: [PATCH 1/2] mm/damon/paddr: fix folio_size() call after
folio_put() in damon_pa_young()
On 2023/3/5 3:39, SeongJae Park wrote:
> damon_pa_young() is accessing a folio via folio_size() after folio_put()
> for the folio has invoked. Fix it.
>
Reviewed-by: Kefeng Wang <wangkefeng.wang@...wei.com>
> Fixes: 397b0c3a584b ("mm/damon/paddr: remove folio_sz field from damon_pa_access_chk_result")
> Cc: <stable@...r.kernel.org> # 6.3.x
> Signed-off-by: SeongJae Park <sj@...nel.org>
> ---
> mm/damon/paddr.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index 3fda00a0f786..10f159b315ea 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -130,7 +130,6 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)
> accessed = false;
> else
> accessed = true;
> - folio_put(folio);
> goto out;
> }
>
> @@ -144,10 +143,10 @@ static bool damon_pa_young(unsigned long paddr, unsigned long *folio_sz)
>
> if (need_lock)
> folio_unlock(folio);
> - folio_put(folio);
>
> out:
> *folio_sz = folio_size(folio);
> + folio_put(folio);
> return accessed;
> }
>
Powered by blists - more mailing lists