Linux Test Project
 help / color / mirror / Atom feed
* [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants
@ 2026-04-27 15:01 Martin Doucha
  2026-04-27 15:50 ` [LTP] " linuxtestproject.agent
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Martin Doucha @ 2026-04-27 15:01 UTC (permalink / raw)
  To: ltp

Add fallback definitions for IORING_OP_READ and IORING_OP_WRITE.
These constants have been added in kernel v5.6 and older systems may
lack them, which results in LTP build failures.

Fixes: fcc4887e73 ("io_uring: Test IORING READ and WRITE operations")
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---

Changes since v1:
- Fixed preprocessor conditions in io_uring.h

 configure.ac            |  2 ++
 include/lapi/io_uring.h | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/configure.ac b/configure.ac
index 812f17d8b..4b789bfe3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,6 +46,8 @@ AC_CHECK_DECLS([MADV_MERGEABLE],,,[#include <sys/mman.h>])
 AC_CHECK_DECLS([NFTA_CHAIN_ID, NFTA_VERDICT_CHAIN_ID],,,[#include <linux/netfilter/nf_tables.h>])
 AC_CHECK_DECLS([PR_CAPBSET_DROP, PR_CAPBSET_READ],,,[#include <sys/prctl.h>])
 AC_CHECK_DECLS([SEM_STAT_ANY],,,[#include <sys/sem.h>])
+AC_CHECK_DECLS([IORING_OP_READ],,,[#include <linux/io_uring.h>])
+AC_CHECK_DECLS([IORING_OP_WRITE],,,[#include <linux/io_uring.h>])
 
 AC_CHECK_HEADERS_ONCE([ \
     aio.h \
diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h
index c05517595..2026863a2 100644
--- a/include/lapi/io_uring.h
+++ b/include/lapi/io_uring.h
@@ -253,6 +253,16 @@ struct io_uring_probe {
 	struct io_uring_probe_op ops[0];
 };
 
+#else /* IOSQE_FIXED_FILE */
+
+#if !HAVE_DECL_IORING_OP_READ
+#define IORING_OP_READ 22
+#endif
+
+#if !HAVE_DECL_IORING_OP_WRITE
+#define IORING_OP_WRITE 23
+#endif
+
 #endif /* IOSQE_FIXED_FILE */
 
 #ifndef IOSQE_IO_HADRLINK
-- 
2.53.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [LTP] lapi/io_uring: Add IORING_OP_READ/WRITE constants
  2026-04-27 15:01 [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants Martin Doucha
@ 2026-04-27 15:50 ` linuxtestproject.agent
  2026-04-28  6:25 ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
  2026-04-28  6:34 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: linuxtestproject.agent @ 2026-04-27 15:50 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp, LTP AI Reviewer

Hi Martin,

On Mon, 27 Apr 2026 17:01:35 +0200, Martin Doucha wrote:
> lapi/io_uring: Add IORING_OP_READ/WRITE constants

> +#else /* IOSQE_FIXED_FILE */
> +
> +#if !HAVE_DECL_IORING_OP_READ
> +#define IORING_OP_READ 22
> +#endif
> +
> +#if !HAVE_DECL_IORING_OP_WRITE
> +#define IORING_OP_WRITE 23
> +#endif

Placement and values are correct: IOSQE_FIXED_FILE was introduced in v5.1,
IORING_OP_READ/WRITE in v5.6, so this handles the v5.1-v5.5 gap cleanly.

Reviewed-by: LTP AI Reviewer <ltp-ai@noreply.github.com>

---
Note:

Our agent completed the review of the patch.

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants
  2026-04-27 15:01 [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants Martin Doucha
  2026-04-27 15:50 ` [LTP] " linuxtestproject.agent
@ 2026-04-28  6:25 ` Andrea Cervesato via ltp
  2026-04-28  6:34 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2026-04-28  6:25 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

LGTM

Reviewed-by: Andrea Cervesato <andrea.cervesato@suse.com>
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants
  2026-04-27 15:01 [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants Martin Doucha
  2026-04-27 15:50 ` [LTP] " linuxtestproject.agent
  2026-04-28  6:25 ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
@ 2026-04-28  6:34 ` Andrea Cervesato via ltp
  2 siblings, 0 replies; 4+ messages in thread
From: Andrea Cervesato via ltp @ 2026-04-28  6:34 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Merged, thanks!

--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-28  6:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-27 15:01 [LTP] [PATCH v2] lapi/io_uring: Add IORING_OP_READ/WRITE constants Martin Doucha
2026-04-27 15:50 ` [LTP] " linuxtestproject.agent
2026-04-28  6:25 ` [LTP] [PATCH v2] " Andrea Cervesato via ltp
2026-04-28  6:34 ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox