summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-05-29 11:35:33 -0600
committerJens Axboe <axboe@kernel.dk>2020-05-29 11:35:33 -0600
commitcb681c394dca54a88101e17168cb7881a05984ae (patch)
treeef56d047becdefa72c0ca61b92e80e9996f6eb1f
parentdb4d0388694403998cda03ace5f31fd8a2acd6fc (diff)
downloadliburing-cb681c394dca54a88101e17168cb7881a05984ae.tar.gz
liburing-cb681c394dca54a88101e17168cb7881a05984ae.tar.bz2
test/iopoll: skip test if file/device/fs doesn't supported polled IO
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/iopoll.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/iopoll.c b/test/iopoll.c
index 1ac5a7c..296dad2 100644
--- a/test/iopoll.c
+++ b/test/iopoll.c
@@ -20,6 +20,7 @@
static struct iovec *vecs;
static int no_buf_select;
+static int no_iopoll;
static int create_buffers(void)
{
@@ -190,6 +191,10 @@ static int __test_io(const char *file, struct io_uring *ring, int write, int sqt
if (ret) {
fprintf(stderr, "wait_cqe=%d\n", ret);
goto err;
+ } else if (cqe->res == -EOPNOTSUPP) {
+ fprintf(stdout, "File/device/fs doesn't support polled IO\n");
+ no_iopoll = 1;
+ break;
} else if (cqe->res != BS) {
fprintf(stderr, "cqe res %d, wanted %d\n", cqe->res, BS);
goto err;
@@ -313,6 +318,8 @@ int main(int argc, char *argv[])
fprintf(stderr, "test_io failed %d/%d/%d/%d\n", v1, v2, v3, v4);
goto err;
}
+ if (no_iopoll)
+ break;
}
if (fname != argv[1])