From: SeongJae Park Date: Sun, 21 Sep 2025 14:11:19 +0000 (-0400) Subject: samples/damon/mtier: avoid starting DAMON before initialization X-Git-Tag: v6.16.9~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9fa006e35272c025fe587a067e9f9f87e8ea9fc;p=thirdparty%2Fkernel%2Fstable.git samples/damon/mtier: avoid starting DAMON before initialization [ Upstream commit c62cff40481c037307a13becbda795f7afdcfebd ] Commit 964314344eab ("samples/damon/mtier: support boot time enable setup") is somehow incompletely applying the origin patch [1]. It is missing the part that avoids starting DAMON before module initialization. Probably a mistake during a merge has happened. Fix it by applying the missed part again. Link: https://lkml.kernel.org/r/20250909022238.2989-4-sj@kernel.org Link: https://lore.kernel.org/20250706193207.39810-4-sj@kernel.org [1] Fixes: 964314344eab ("samples/damon/mtier: support boot time enable setup") Signed-off-by: SeongJae Park Cc: Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c index 11cbfea1af675..88156145172f1 100644 --- a/samples/damon/mtier.c +++ b/samples/damon/mtier.c @@ -166,6 +166,9 @@ static int damon_sample_mtier_enable_store( if (enabled == is_enabled) return 0; + if (!init_called) + return 0; + if (enabled) { err = damon_sample_mtier_start(); if (err)