selftests/damon: add a test for the pid leak of dbgfs_target_ids_write()
authorSeongJae Park <sj@kernel.org>
Wed, 7 Feb 2024 20:31:33 +0000 (12:31 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:56 +0000 (10:24 -0800)
commitf08db42b1c3a6c62ab13ac466f5d8d72d3dd79c5
treeaf4e4f76fc484b7f29ef3b6221bf668531974323
parente6255a297628ddd7ead9cf8fb2ce11168595c89d
selftests/damon: add a test for the pid leak of dbgfs_target_ids_write()

Commit ebb3f994dd92 ("mm/damon/dbgfs: fix 'struct pid' leaks in
'dbgfs_target_ids_write()'") fixes a pid leak bug in DAMON debugfs
interface, namely dbgfs_target_ids_write() function.  Add a selftest for
the issue to prevent the problem from mistakenly recurring.

Link: https://lkml.kernel.org/r/20240207203134.69976-8-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/damon/.gitignore
tools/testing/selftests/damon/Makefile
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.c [new file with mode: 0644]
tools/testing/selftests/damon/debugfs_target_ids_pid_leak.sh [new file with mode: 0644]