From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: 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 02/10] selftests/damon/_damon_sysfs: check errors from nr_schemes file reads
Date: Fri, 3 May 2024 11:03:10 -0700 [thread overview]
Message-ID: <20240503180318.72798-3-sj@kernel.org> (raw)
In-Reply-To: <20240503180318.72798-1-sj@kernel.org>
DAMON context staging method in _damon_sysfs.py is not checking the
returned error from nr_schemes file read. Check it.
Fixes: f5f0e5a2bef9 ("selftests/damon/_damon_sysfs: implement kdamonds start function")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
tools/testing/selftests/damon/_damon_sysfs.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py
index f80fdcef507c..fffa74a78bd7 100644
--- a/tools/testing/selftests/damon/_damon_sysfs.py
+++ b/tools/testing/selftests/damon/_damon_sysfs.py
@@ -341,6 +341,8 @@ class DamonCtx:
nr_schemes_file = os.path.join(
self.sysfs_dir(), 'schemes', 'nr_schemes')
content, err = read_file(nr_schemes_file)
+ if err is not None:
+ return err
if int(content) != len(self.schemes):
err = write_file(nr_schemes_file, '%d' % len(self.schemes))
if err != None:
--
2.39.2
next prev parent reply other threads:[~2024-05-03 18:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-03 18:03 [PATCH 00/10] mm/damon: misc fixes and improvements SeongJae Park
2024-05-03 18:03 ` [PATCH 01/10] mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() SeongJae Park
2024-05-03 18:03 ` SeongJae Park [this message]
2024-05-03 18:03 ` [PATCH 03/10] selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts SeongJae Park
2024-05-03 18:03 ` [PATCH 04/10] selftests/damon/_damon_sysfs: use 'is' instead of '==' for 'None' SeongJae Park
2024-05-03 18:03 ` [PATCH 05/10] selftests/damon: classify tests for functionalities and regressions SeongJae Park
2024-05-03 18:03 ` [PATCH 06/10] Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file SeongJae Park
2024-05-03 18:03 ` [PATCH 07/10] Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command SeongJae Park
2024-05-03 18:03 ` [PATCH 08/10] Docs/mm/damon/design: use a list for supported filters SeongJae Park
2024-05-03 18:03 ` [PATCH 09/10] Docs/mm/damon/maintainer-profile: change the maintainer's timezone from PST to PT SeongJae Park
2024-05-03 18:03 ` [PATCH 10/10] Docs/mm/damon/maintainer-profile: allow posting patches based on damon/next tree SeongJae Park
2024-05-03 18:06 ` [PATCH 00/10] mm/damon: misc fixes and improvements 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=20240503180318.72798-3-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.