Re: [PATCH] selftests/damon: check correct path in ensure_file() not_exist case

From: SJ Park

Date: Mon Jul 06 2026 - 10:45:31 EST


+ Andrew

On Mon, 6 Jul 2026 21:43:04 +0800 wang wei <a929244872@xxxxxxx> wrote:

> In the ensure_file() function, the "not_exist" code path checks
> whether $dir exists as a regular file. However, the intent is to
> verify that the target file ($file) does not exist, not the $dir.
> Testing $dir makes the existence check effectively useless --
> it tests the wrong path and thus never catches the case
> where the file is unexpectedly present.
>
> Replace $dir with $file so the not_exist verification targets the
> correct path.

Nice catch, thank you!

>
> Signed-off-by: wang wei <a929244872@xxxxxxx>

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

[...]