Thread (2 messages) 2 messages, 2 authors, 2021-08-21
STALE1797d

[PATCH liburing] tests: fix test_cancel_req_across_fork

From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2021-08-21 14:22:44
Subsystem: the rest · Maintainer: Linus Torvalds

Rarely, the request we're trying to cancel may not yet got picked by
a worker, and so the cancel request returns 0 instead of -EALREADY, and
it's a valid output we should consider.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 test/io-cancel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/io-cancel.c b/test/io-cancel.c
index 9a36dd9..a4cc361 100644
--- a/test/io-cancel.c
+++ b/test/io-cancel.c
@@ -339,7 +339,7 @@ static int test_cancel_req_across_fork(void)
 				return 1;
 			}
 			if ((cqe->user_data == 1 && cqe->res != -EINTR) ||
-			    (cqe->user_data == 2 && cqe->res != -EALREADY)) {
+			    (cqe->user_data == 2 && cqe->res != -EALREADY && cqe->res)) {
 				fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
 				exit(1);
 			}
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help