]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
samples/damon/wsse: avoid starting DAMON before initialization
authorSeongJae Park <sj@kernel.org>
Tue, 9 Sep 2025 02:22:36 +0000 (19:22 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 12 Sep 2025 00:23:40 +0000 (17:23 -0700)
Patch series "samples/damon: fix boot time enable handling fixup merge
mistakes".

First three patches of the patch series "mm/damon: fix misc bugs in DAMON
modules" [1] were trying to fix boot time DAMON sample modules enabling
issues.  The issues are the modules can crash if those are enabled before
DAMON is enabled, like using boot time parameter options.  The three
patches were fixing the issues by avoiding starting DAMON before the
module initialization phase.

However, probably by a mistake during a merge, only half of the change is
merged, and the part for avoiding the starting of DAMON before the module
initialized is missed.  So the problem is not solved and thus the modules
can still crash if enabled before DAMON is initialized.  Fix those by
applying the unmerged parts again.

Note that the broken commits are merged into 6.17-rc1, but also backported
to relevant stable kernels.  So this series also needs to be merged into
the stable kernels.  Hence Cc-ing stable@.

This patch (of 3):

Commit 0ed1165c3727 ("samples/damon/wsse: fix boot time enable handling")
is somehow incompletely applying the origin patch [2].  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-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20250909022238.2989-2-sj@kernel.org
Link: https://lkml.kernel.org/r/20250706193207.39810-1-sj@kernel.org
Link: https://lore.kernel.org/20250706193207.39810-2-sj@kernel.org
Fixes: 0ed1165c3727 ("samples/damon/wsse: fix boot time enable handling")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
samples/damon/wsse.c

index da052023b099071bddc6ce76bbef74abfd2b46ab..21eaf15f987d47f5ec8e654365cf05ad37c9b61a 100644 (file)
@@ -118,6 +118,9 @@ static int damon_sample_wsse_enable_store(
                return 0;
 
        if (enabled) {
+               if (!init_called)
+                       return 0;
+
                err = damon_sample_wsse_start();
                if (err)
                        enabled = false;