summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2019-07-20 21:21:02 +0200
committerJeff Moyer <jmoyer@redhat.com>2019-07-29 14:06:24 -0400
commitb7e04d72bda89f22ce013030358e6743417f7fea (patch)
tree3f92829654b7e39cbbbf3bd8ef1ebe4fa416f2fd
parentac60a850d5ce22ae21e3746f72a9ebb2623d17f8 (diff)
downloadlibaio-b7e04d72bda89f22ce013030358e6743417f7fea.tar.gz
harness: Handle -ENOTSUP from io_submit() with RWF_NOWAIT
On filesystems such as tmpfs the syscall might return -ENOTSUP instead of EINVAL when it does not support the RWF_NOWAIT flag. Signed-off-by: Guillem Jover <guillem@hadrons.org> [JEM: skip the test instead of returning success] [JEM: make the error message differentiate between kernel and fs support] Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
-rw-r--r--harness/cases/21.t12
1 files changed, 7 insertions, 5 deletions
diff --git a/harness/cases/21.t b/harness/cases/21.t
index ba988ed..4164c02 100644
--- a/harness/cases/21.t
+++ b/harness/cases/21.t
@@ -108,13 +108,15 @@ test_main()
ret = io_submit(ctx, 1, &iocbp);
/*
- * io_submit will return -EINVAL if RWF_NOWAIT is not supported.
+ * io_submit will return -EINVAL if RWF_NOWAIT is not supported by
+ * the kernel, and EOPNOTSUPP if it's not supported by the fs.
*/
if (ret != 1) {
- if (ret == -EINVAL) {
- fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n");
- /* just return success */
- return 0;
+ if (ret == -EINVAL || ret == -ENOTSUP) {
+ fprintf(stderr, "RWF_NOWAIT not supported by %s.\n",
+ ret == -EINVAL ? "kernel" : "file system");
+ /* skip this test */
+ return 3;
}
errno = -ret;
perror("io_submit");