selftests/damon: test debugfs file reads/writes with huge count
authorSeongJae Park <sj@kernel.org>
Fri, 10 Dec 2021 22:46:55 +0000 (14:46 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:32:51 +0000 (09:32 +0100)
commit581b097951991e58ee3219987646ffaeee78eec3
tree7629392a7edde4b486c3aa6e084670ee74a8273e
parenta272f990cb266c7c31e5a687bd6838aed68322b6
selftests/damon: test debugfs file reads/writes with huge count

commit b4a002889d24979295ed3c2bf1d5fcfb3901026a upstream.

DAMON debugfs interface users were able to trigger warning by writing
some files with arbitrarily large 'count' parameter.  The issue is fixed
with commit db7a347b26fe ("mm/damon/dbgfs: use '__GFP_NOWARN' for
user-specified size buffer allocation").  This commit adds a test case
for the issue in DAMON selftests to avoid future regressions.

Link: https://lkml.kernel.org/r/20211201150440.1088-11-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/damon/.gitignore [new file with mode: 0644]
tools/testing/selftests/damon/Makefile
tools/testing/selftests/damon/debugfs_attrs.sh
tools/testing/selftests/damon/huge_count_read_write.c [new file with mode: 0644]