[PATCH 5/7] harness: Handle -ENOTSUP from io_submit() with RWF_NOWAIT
authorGuillem Jover <guillem@hadrons.org>
Tue, 26 Feb 2019 01:57:05 +0000 (02:57 +0100)
committerGuillem Jover <guillem@debian.org>
Tue, 26 Feb 2019 04:26:21 +0000 (04:26 +0000)
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>
Gbp-Pq: Name 0005-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch

harness/cases/21.t

index 352bf887d6a64a83999f8b2e3ea557e333e90108..52206be5f6a2e9ef0fb06d5f1397ac0a522c0715 100644 (file)
@@ -105,10 +105,11 @@ test_main()
        ret = io_submit(ctx, 1, &iocbp);
 
        /*
-        * io_submit will return -EINVAL if RWF_NOWAIT is not supported.
+        * io_submit will return -EINVAL or -ENOTSUP if RWF_NOWAIT is not
+        * supported.
         */
        if (ret != 1) {
-               if (ret == -EINVAL) {
+               if (ret == -EINVAL || ret == -ENOTSUP) {
                        fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n");
                        /* just return success */
                        return 0;