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>
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 @@
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);
}