From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrew Paniakin <apanyaki@amazon.com>,
SeongJae Park <sj@kernel.org>, Shuah Khan <shuah@kernel.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/6] selftests/damon/huge_count_read_write: provide sufficiently large buffer for DEPRECATED file read
Date: Mon, 28 Oct 2024 16:30:53 -0700 [thread overview]
Message-ID: <20241028233058.283381-2-sj@kernel.org> (raw)
In-Reply-To: <20241028233058.283381-1-sj@kernel.org>
From: Andrew Paniakin <apanyaki@amazon.com>
'huge_count_read_write' crashes with segmentation fault when reading
DEPRECATED file of DAMON debugfs interface. This is not causing any
problem for users or other tests because the purpose of the test is just
ensuring the read is not causing kernel warning messages. Nonetheless,
it makes the output unnecessarily noisy, and the DEPRECATED file is not
properly being tested.
It happens because the size of the content of the file is larger than
the size of the buffer for the read. The file contains about 170
characters. Increase the buffer size to 256 characters.
Fixes: b4a002889d24 ("selftests/damon: test debugfs file reads/writes with huge count")
Signed-off-by: Andrew Paniakin <apanyaki@amazon.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Note that this fix has originally wrote[1] by Andrew for the downstream
version of the same test. Because the downstream version is hosted on
GitHub, the original patch was posted via GitHub pull request, not to
the mailing list.
[1] https://github.com/damonitor/damon-tests/commit/fec6e1f4559a
tools/testing/selftests/damon/huge_count_read_write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c
index a6fe0689f88d..f3c199dc8eba 100644
--- a/tools/testing/selftests/damon/huge_count_read_write.c
+++ b/tools/testing/selftests/damon/huge_count_read_write.c
@@ -18,7 +18,7 @@
void write_read_with_huge_count(char *file)
{
int filedesc = open(file, O_RDWR);
- char buf[25];
+ char buf[256];
int ret;
printf("%s %s\n", __func__, file);
--
2.39.5
next prev parent reply other threads:[~2024-10-28 23:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 23:30 [PATCH 0/6] damon/{self,kunit}tests: minor fixups for DAMON debugfs interface tests SeongJae Park
2024-10-28 23:30 ` SeongJae Park [this message]
2024-10-28 23:30 ` [PATCH 2/6] selftests/damon/huge_count_read_write: remove unnecessary debugging message SeongJae Park
2024-10-28 23:30 ` [PATCH 3/6] selftests/damon/_debugfs_common: hide expected error message from test_write_result() SeongJae Park
2024-10-28 23:30 ` [PATCH 4/6] selftests/damon/debugfs_duplicate_context_creation: hide errors from expected file write failures SeongJae Park
2024-10-28 23:30 ` [PATCH 5/6] mm/damon/Kconfig: update DBGFS_KUNIT prompt copy for SYSFS_KUNIT SeongJae Park
2024-10-28 23:30 ` [PATCH 6/6] mm/damon/tests/dbgfs-kunit: fix the header double inclusion guarding ifdef comment SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241028233058.283381-2-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=apanyaki@amazon.com \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox