* [PATCH] kselftest/filelock: plan for the five ofdlocks tests
@ 2026-09-25 20:55 Danish Khateeb
0 siblings, 0 replies; only message in thread
From: Danish Khateeb @ 2026-09-25 20:55 UTC (permalink / raw)
To: Andrew Morton
Cc: Shuah Khan, Mark Brown, Jeff Layton, linux-kselftest,
linux-kernel, Danish Khateeb
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-25 20:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 20:55 [PATCH] kselftest/filelock: plan for the five ofdlocks tests Danish Khateeb
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®