Re: [PATCH v1] mm/damon/sysfs: propagate damon_call() error in turn_damon_on
From: SJ Park
Date: Tue Sep 15 2026 - 13:36:30 EST
On Tue, 15 Sep 2026 17:39:28 +0800 Xuewen Wang <wangxuewen@xxxxxxxxxx> wrote:
> damon_sysfs_turn_damon_on() ignored the return value of damon_call()
> for the repeat call control registration and always returned the stale
> result of damon_start() (0 at that point). When damon_call() fails,
> e.g., the kdamond is already exiting, the user still gets success from
> the state file write while monitoring is not actually on.
>
> Save and return the damon_call() result instead. No rollback of
> damon_start() is needed since a failed damon_call() guarantees the
> context is stopped.
Nice catch, thank you for fixing this!
>
> Signed-off-by: Xuewen Wang <wangxuewen@xxxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
This patch is applied to damon/next [1] tree. If this patch is not added to
mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton)
to pick this. So, no action from your side is needed for now. If it seems I
also forgot doing that or you cannot wait for my action, please feel free to
directly ask that to Andrew.
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]