All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cve/ghostlock.c: Print return value and attempt in TBROK message
@ 2026-11-10 15:25 Avinesh Kumar via ltp
  2026-11-10 15:36 ` Petr Vorel
  0 siblings, 1 reply; 2+ messages in thread
From: Avinesh Kumar via ltp @ 2026-11-10 15:25 UTC (permalink / raw)
  To: ltp

From: Avinesh Kumar <avinesh.kumar@suse.com>

The check after FUTEX_CMP_REQUEUE_PI breaks if the call did not fail
with EDEADLK, but the message only said "did not return -EDEADLK" and
TTERRNO appended errno, which is 0 when the call succeeds. The resulting
"SUCCESS (0)" reads like a return value of 0 and hides what the call
actually returned.

ghostlock.c:243: TBROK: FUTEX_CMP_REQUEUE_PI did not return -EDEADLK: SUCCESS (0)

Print TST_RET and the attempt number, so a TBROK here shows right away
whether the call succeeded (and how many waiters it moved) or failed
with another errno, and on which attempt it happened.

Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
 testcases/cve/ghostlock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/testcases/cve/ghostlock.c b/testcases/cve/ghostlock.c
index 3afedf9ab5ad..b37d6e9ca4e1 100644
--- a/testcases/cve/ghostlock.c
+++ b/testcases/cve/ghostlock.c
@@ -240,7 +240,9 @@ static void run(void)
 		if (TST_ERR == ENOSYS)
 			tst_brk(TCONF, "FUTEX_CMP_REQUEUE_PI not supported");
 		if (TST_RET != -1 || TST_ERR != EDEADLK)
-			tst_brk(TBROK | TTERRNO, "FUTEX_CMP_REQUEUE_PI did not return -EDEADLK");
+			tst_brk(TBROK | TTERRNO,
+				"FUTEX_CMP_REQUEUE_PI returned %ld on attempt %d/%d, expected -EDEADLK",
+				TST_RET, i + 1, ATTEMPTS);
 
 		TST_CHECKPOINT_WAIT2(CP_SPRAYED, 18000);
 
-- 
2.56.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-10 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 15:25 [LTP] [PATCH] cve/ghostlock.c: Print return value and attempt in TBROK message Avinesh Kumar via ltp
2026-11-10 15:36 ` Petr Vorel

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.