diff options
| author | SeongJae Park <sj@kernel.org> | 2025-07-06 12:32:05 -0700 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-07-13 16:38:34 -0700 |
| commit | 737e40d5eb2f6507113285cb52c50a4a6b01f44a (patch) | |
| tree | 65e347e46f5f4c7d724c8302780c6458d33bb118 | |
| parent | 964314344eab7bc43e38a32be281c5ea0609773b (diff) | |
mm/damon/reclaim: reset enabled when DAMON start failed
When the startup fails, 'enabled' parameter is not reset. As a result,
users show the parameter 'Y' while it is not really working. Fix it by
resetting 'enabled' to 'false' when the work is failed.
Link: https://lkml.kernel.org/r/20250706193207.39810-5-sj@kernel.org
Fixes: 04e98764befa ("mm/damon/reclaim: enable and disable synchronously")
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
| -rw-r--r-- | mm/damon/reclaim.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c index a675150965e0..c91098d8aa51 100644 --- a/mm/damon/reclaim.c +++ b/mm/damon/reclaim.c @@ -329,7 +329,7 @@ static int __init damon_reclaim_init(void) int err = damon_modules_new_paddr_ctx_target(&ctx, &target); if (err) - return err; + goto out; ctx->callback.after_wmarks_check = damon_reclaim_after_wmarks_check; ctx->callback.after_aggregation = damon_reclaim_after_aggregation; @@ -338,6 +338,9 @@ static int __init damon_reclaim_init(void) if (enabled) err = damon_reclaim_turn(true); +out: + if (err && enabled) + enabled = false; return err; } |