0023-harness-Handle-ENOTSUP-from-io_submit-with-RWF_NOWAI.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From b7e04d72bda89f22ce013030358e6743417f7fea Mon Sep 17 00:00:00 2001
  2. From: Guillem Jover <guillem@hadrons.org>
  3. Date: Sat, 20 Jul 2019 21:21:02 +0200
  4. Subject: [PATCH libaio 23/28] harness: Handle -ENOTSUP from io_submit() with
  5. RWF_NOWAIT
  6. On filesystems such as tmpfs the syscall might return -ENOTSUP instead
  7. of EINVAL when it does not support the RWF_NOWAIT flag.
  8. Signed-off-by: Guillem Jover <guillem@hadrons.org>
  9. [JEM: skip the test instead of returning success]
  10. [JEM: make the error message differentiate between kernel and fs support]
  11. Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
  12. ---
  13. harness/cases/21.t | 12 +++++++-----
  14. 1 file changed, 7 insertions(+), 5 deletions(-)
  15. diff --git a/harness/cases/21.t b/harness/cases/21.t
  16. index ba988ed..4164c02 100644
  17. --- a/harness/cases/21.t
  18. +++ b/harness/cases/21.t
  19. @@ -108,13 +108,15 @@ test_main()
  20. ret = io_submit(ctx, 1, &iocbp);
  21. /*
  22. - * io_submit will return -EINVAL if RWF_NOWAIT is not supported.
  23. + * io_submit will return -EINVAL if RWF_NOWAIT is not supported by
  24. + * the kernel, and EOPNOTSUPP if it's not supported by the fs.
  25. */
  26. if (ret != 1) {
  27. - if (ret == -EINVAL) {
  28. - fprintf(stderr, "RWF_NOWAIT not supported by kernel.\n");
  29. - /* just return success */
  30. - return 0;
  31. + if (ret == -EINVAL || ret == -ENOTSUP) {
  32. + fprintf(stderr, "RWF_NOWAIT not supported by %s.\n",
  33. + ret == -EINVAL ? "kernel" : "file system");
  34. + /* skip this test */
  35. + return 3;
  36. }
  37. errno = -ret;
  38. perror("io_submit");
  39. --
  40. 2.26.0.292.g33ef6b2f38