From: Danish Khateeb <danishkhateeb03@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Shuah Khan <shuah@kernel.org>, Mark Brown <broonie@kernel.org>,
Jeff Layton <jlayton@kernel.org>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Danish Khateeb <danishkhateeb03@gmail.com>
Subject: [PATCH] kselftest/filelock: plan for the five ofdlocks tests
Date: Fri, 25 Sep 2026 15:55:02 -0500 [thread overview]
Message-ID: <20260925205502.115327-1-danishkhateeb03@gmail.com> (raw)
ofdlocks reports five results but plans for four, so even when they
all pass it ends with
# Planned tests != run tests (4 != 5)
and exits with KSFT_FAIL, which run_kselftest.sh reports as a failure.
Fixes: 33d5b13098fb ("kselftest/filelock: report each test in oftlocks separately")
Assisted-by: LLM
Signed-off-by: Danish Khateeb <danishkhateeb03@gmail.com>
---
Notes:
Tested on x86_64 with the kselftest build of ofdlocks:
- Arch host (gcc 16.2, 7.2.6 kernel): before, all 5 pass but it exits 1
with "Planned tests != run tests (4 != 5)"; after, 5/5 and exit 0.
- Debian trixie guest (gcc 14.2, next-20260925): test 4 fails before and
after this patch, because it memcmp()s two struct flock whose padding
was never initialized (bytes 28-29 differ). Zhou Yuhang's "selftests:
filelock: Initialize the flock to zero" [1] fixes that, and with both
patches all 5 pass there too.
[1] https://lore.kernel.org/all/?q=s%3A%22filelock%3A+Initialize+the+flock+to+zero%22
tools/testing/selftests/filelock/ofdlocks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/filelock/ofdlocks.c b/tools/testing/selftests/filelock/ofdlocks.c
index 68bac28b234b..0ab484cb075b 100644
--- a/tools/testing/selftests/filelock/ofdlocks.c
+++ b/tools/testing/selftests/filelock/ofdlocks.c
@@ -40,7 +40,7 @@ int main(void)
int fd2 = open("/tmp/aa", O_RDONLY);
ksft_print_header();
- ksft_set_plan(4);
+ ksft_set_plan(5);
unlink("/tmp/aa");
assert(fd != -1);
base-commit: aa98230e410f0ed212b6788c46b1e4d49e0ff7ca
--
2.55.0
reply other threads:[~2026-09-25 20:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260925205502.115327-1-danishkhateeb03@gmail.com \
--to=danishkhateeb03@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=jlayton@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.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
all inboxes | Powered by JetHome®