summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-11-06 15:16:23 -0600
committerJens Axboe <axboe@kernel.dk>2021-11-06 15:16:23 -0600
commit7b5681f82bf53b42afc7cb35482036559d5bad42 (patch)
treec0baf243c79f605c0c9ceb5aa798201e1af99661
parent0b6b5bc79a85bc3a461c6f3ba9c0ce0dba696d4c (diff)
downloadliburing-7b5681f82bf53b42afc7cb35482036559d5bad42.tar.gz
liburing-7b5681f82bf53b42afc7cb35482036559d5bad42.tar.bz2
test/io-cancel: -ECANCELED is a valid return value
-EINTR relies on io-wq, we can also find and cancel before that. Make sure the test allows it, fixing the following case failure on newer kernels: 1 -125 child failed 1 test_cancel_req_across_fork() failed Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/io-cancel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/io-cancel.c b/test/io-cancel.c
index b5b443d..703ffa7 100644
--- a/test/io-cancel.c
+++ b/test/io-cancel.c
@@ -341,8 +341,21 @@ static int test_cancel_req_across_fork(void)
fprintf(stderr, "wait_cqe=%d\n", ret);
return 1;
}
- if ((cqe->user_data == 1 && cqe->res != -EINTR) ||
- (cqe->user_data == 2 && cqe->res != -EALREADY && cqe->res)) {
+ switch (cqe->user_data) {
+ case 1:
+ if (cqe->res != -EINTR &&
+ cqe->res != -ECANCELED) {
+ fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
+ exit(1);
+ }
+ break;
+ case 2:
+ if (cqe->res != -EALREADY && cqe->res) {
+ fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
+ exit(1);
+ }
+ break;
+ default:
fprintf(stderr, "%i %i\n", (int)cqe->user_data, cqe->res);
exit(1);
}