* [PATCH -next] mm/damon: fix error return code in damon_reclaim_turn()
@ 2021-10-25 12:45 Yang Yingliang
2021-10-25 13:30 ` SeongJae Park
0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2021-10-25 12:45 UTC (permalink / raw)
To: linux-kernel, linux-mm; +Cc: akpm, sj
If damon_reclaim_new_scheme() fails, it should return
error code in damon_reclaim_turn()
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
mm/damon/reclaim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index f5ae4c422555..dc1485044eaf 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -292,8 +292,10 @@ static int damon_reclaim_turn(bool on)
/* Will be freed by 'damon_set_schemes()' below */
scheme = damon_reclaim_new_scheme();
- if (!scheme)
+ if (!scheme) {
+ err = -ENOMEM;
goto free_region_out;
+ }
err = damon_set_schemes(ctx, &scheme, 1);
if (err)
goto free_scheme_out;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] mm/damon: fix error return code in damon_reclaim_turn()
2021-10-25 12:45 [PATCH -next] mm/damon: fix error return code in damon_reclaim_turn() Yang Yingliang
@ 2021-10-25 13:30 ` SeongJae Park
2021-10-26 7:06 ` SeongJae Park
0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2021-10-25 13:30 UTC (permalink / raw)
To: Yang Yingliang; +Cc: linux-kernel, linux-mm, akpm, sj
On Mon, 25 Oct 2021 20:45:00 +0800 Yang Yingliang <yangyingliang@huawei.com> wrote:
> If damon_reclaim_new_scheme() fails, it should return
> error code in damon_reclaim_turn()
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Thank you for this fix!
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
> ---
> mm/damon/reclaim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
> index f5ae4c422555..dc1485044eaf 100644
> --- a/mm/damon/reclaim.c
> +++ b/mm/damon/reclaim.c
> @@ -292,8 +292,10 @@ static int damon_reclaim_turn(bool on)
>
> /* Will be freed by 'damon_set_schemes()' below */
> scheme = damon_reclaim_new_scheme();
> - if (!scheme)
> + if (!scheme) {
> + err = -ENOMEM;
> goto free_region_out;
> + }
> err = damon_set_schemes(ctx, &scheme, 1);
> if (err)
> goto free_scheme_out;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] mm/damon: fix error return code in damon_reclaim_turn()
2021-10-25 13:30 ` SeongJae Park
@ 2021-10-26 7:06 ` SeongJae Park
0 siblings, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2021-10-26 7:06 UTC (permalink / raw)
To: SeongJae Park; +Cc: Yang Yingliang, linux-kernel, linux-mm, akpm
On Mon, 25 Oct 2021 13:30:02 +0000 SeongJae Park <sj@kernel.org> wrote:
> On Mon, 25 Oct 2021 20:45:00 +0800 Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> > If damon_reclaim_new_scheme() fails, it should return
> > error code in damon_reclaim_turn()
> >
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>
> Thank you for this fix!
>
> Reviewed-by: SeongJae Park <sj@kernel.org>
FWIW, this patch fixes commit 53ab0082dc41 ("mm/damon: introduce DAMON-based
Reclamation (DAMON_RECLAIM)") in -mm[1].
[1] https://github.com/hnaz/linux-mm/commit/53ab0082dc41
Thanks,
SJ
>
>
> Thanks,
> SJ
>
> > ---
> > mm/damon/reclaim.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
> > index f5ae4c422555..dc1485044eaf 100644
> > --- a/mm/damon/reclaim.c
> > +++ b/mm/damon/reclaim.c
> > @@ -292,8 +292,10 @@ static int damon_reclaim_turn(bool on)
> >
> > /* Will be freed by 'damon_set_schemes()' below */
> > scheme = damon_reclaim_new_scheme();
> > - if (!scheme)
> > + if (!scheme) {
> > + err = -ENOMEM;
> > goto free_region_out;
> > + }
> > err = damon_set_schemes(ctx, &scheme, 1);
> > if (err)
> > goto free_scheme_out;
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-26 7:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 12:45 [PATCH -next] mm/damon: fix error return code in damon_reclaim_turn() Yang Yingliang
2021-10-25 13:30 ` SeongJae Park
2021-10-26 7:06 ` SeongJae Park
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.