selftests/damon/sysfs_memcg_path_leak: define ksft_skip
Subsystems (4)
SJ Park
maintainerRFC PATCH 1/1 selftests/damon/sysfs_memcg_path_leak: define ksft_skip
sysfs_memcg_path_leak test uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below.
$ ./sysfs_memcg_path_leak.sh
Run as root
$ echo $?
0Users who run the test could therefore wrongly believe the test was run and passed while it was skipped.
Define the value at the beginning of the test. After this patch, the exit code reflects the skip.
$ ./sysfs_memcg_path_leak.sh
Run as root
$ echo $?
4--- tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 3 +++ 1 file changed, 3 insertions(+)
tools/testing/selftests/damon/sysfs_memcg_path_leak.sh +3 -0
@@ -1,6 +1,9 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + if [ $EUID -ne 0 ] then echo "Run as root"
base-commit: 20b1ca206f8a664a16ad3006262c63b5d37b1ecc
Signature · 1 line
2.47.3
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 19 lines
sysfs_memcg_path_leaktest uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below.$ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 0Users who run the test could therefore wrongly believe the test was run and passed while it was skipped.
Define the value at the beginning of the test. After this patch, the exit code reflects the skip.
$ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 4
Quoted 4 lines
Fixes dfa3cf0bc018 ("selftets/damon: add a test for memcg_path leak")Cc <[email protected]> # 6.17.xSigned-off-by SJ Park <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Hi SJ,
Quoted 1 line · On Thu, 29 Oct 2026 21:46:42 -0700 SJ Park wrote:
Define the value at the beginning of the test.
Makes sense to me.
Thanks,
Aveline Noir
SJ Park
maintainerQuoted 7 lines · On Sat, 31 Oct 2026 15:36:00 +1100 Aveline Noir <[email protected]> wrote:
Hi SJ,
Quoted 1 line · On Thu, 29 Oct 2026 21:46:42 -0700 SJ Park wrote:
Define the value at the beginning of the test.
Makes sense to me.
Thank you for reviewing, Aveline. No pressure, but have you forgot giving your
Reviewed-by: tag?
Thanks,
SJ
[...]
Hi SJ,
Quoted 1 line · On Sat, 31 Oct 2026 08:38:58 -0700 SJ Park wrote:
Thank you for reviewing, Aveline.
Oh, looks like I forgot that. Thanks for the reminder.
That also gives me an idea: maybe I could build a modular tool to help write emails. Building on b4 might be a good starting point.
Tested the non-root skip path on x86-64 Linux with Bash 5.3.20:
the exit status changed from 0 to 4.
Thanks,
Aveline Noir
SJ Park
maintainerQuoted 7 lines · On Sun, 01 Nov 2026 03:34:41 +1100 Aveline Noir <[email protected]> wrote:
Hi SJ,
Quoted 1 line · On Sat, 31 Oct 2026 08:38:58 -0700 SJ Park wrote:
Thank you for reviewing, Aveline.
Oh, looks like I forgot that. Thanks for the reminder.
No worries!
Quoted 3 lines
That also gives me an idea: maybe I could build a modular tool to help write emails. Building on b4 might be a good starting point.
Sounds like a good plan!
Quoted 6 lines
Tested the non-root skip path on x86-64 Linux with Bash 5.3.20:
the exit status changed from 0 to 4.Reviewed-by Aveline Noir <[email protected]>Tested-by Aveline Noir <[email protected]>
Thank you for reviewing and testing!
Thanks,
SJ
[...]