| Context |
Check |
Description |
| ltpci/github-build-doc |
success
|
success
|
| ltpci/github-build-debian_stable_s390x-linux-gnu-gcc_s390x |
success
|
success
|
| ltpci/github-build-debian_stable_gcc |
success
|
success
|
| ltpci/github-build-debian_stable_aarch64-linux-gnu-gcc_arm64 |
success
|
success
|
| ltpci/github-build-debian_testing_clang |
success
|
success
|
| ltpci/github-build-quay-io-centos-centos_stream9_gcc |
success
|
success
|
| ltpci/github-build-debian_stable_powerpc64le-linux-gnu-gcc_ppc64el |
success
|
success
|
| ltpci/github-build-debian_oldstable_gcc |
success
|
success
|
| ltpci/github-build-debian_testing_gcc |
success
|
success
|
| ltpci/github-build-debian_oldstable_clang |
success
|
success
|
| ltpci/github-build-opensuse-archive_42-2_gcc |
success
|
success
|
| ltpci/github-build-alpine_latest_gcc |
success
|
success
|
| ltpci/github-build-fedora_latest_clang |
success
|
success
|
| ltpci/github-build-debian_stable_gcc |
success
|
success
|
| ltpci/github-build-ubuntu_jammy_gcc |
success
|
success
|
| ltpci/github-build-opensuse-leap_latest_gcc |
success
|
success
|
| ltpci/github-build-ubuntu_noble_gcc |
success
|
success
|
| ltpci/copilot-review |
success
|
Approved
|
@@ -1905,6 +1905,7 @@ io_uring01 io_uring01
io_uring02 io_uring02
io_uring03 io_uring03
io_uring04 io_uring04
+io_uring05 io_uring05
# Tests below may cause kernel memory leak
perf_event_open03 perf_event_open03
@@ -2,3 +2,4 @@
/io_uring02
/io_uring03
/io_uring04
+/io_uring05
new file mode 100644
@@ -0,0 +1,98 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ */
+/*\
+ * Test partial vector operations with IORING_OP_READV and IORING_OP_WRITEV.
+ *
+ * This test validates vectored I/O operations using partial vector sets
+ * and different file offsets. It performs:
+ * 1. IORING_OP_WRITEV - Writing first half using first 2 vectors at offset 0
+ * 2. IORING_OP_WRITEV - Writing second half using next 2 vectors at offset
+ * 2048
+ * 3. IORING_OP_READV - Reading entire file using all 4 vectors
+ * 4. Data integrity verification across all vectors
+ */
+
+#include "io_uring_common.h"
+
+#define TEST_FILE "io_uring_test_file"
+#define QUEUE_DEPTH 2
+#define NUM_VECS 4
+#define VEC_SIZE 1024
+
+static struct iovec *write_iovs, *read_iovs;
+static struct io_uring_submit s;
+static sigset_t sig;
+static int fd = -1;
+
+static void run(void)
+{
+ int half_size = 2 * VEC_SIZE;
+
+ fd = -1;
+
+ io_uring_init_iovec_pattern(write_iovs, NUM_VECS, 'A', 1);
+ io_uring_clear_iovec(read_iovs, NUM_VECS);
+
+ fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+ tst_res(TINFO, "Writing first half using first 2 vectors at offset 0");
+ /* Write first half using first 2 vectors at offset 0 */
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_WRITEV, write_iovs, 2, 0,
+ half_size, &sig);
+
+ tst_res(TINFO,
+ "Writing second half using next 2 vectors at offset %d",
+ half_size);
+ /* Write second half using next 2 vectors at offset half_size */
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_WRITEV, &write_iovs[2], 2,
+ half_size, half_size, &sig);
+
+ SAFE_FSYNC(fd);
+
+ tst_res(TINFO, "Reading entire file using all 4 vectors");
+ /* Read back entire file using all 4 vectors */
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_READV, read_iovs, NUM_VECS, 0,
+ NUM_VECS * VEC_SIZE, &sig);
+
+ io_uring_verify_iovec(write_iovs, read_iovs, NUM_VECS);
+
+ SAFE_CLOSE(fd);
+}
+
+static void setup(void)
+{
+ io_uring_setup_supported_by_kernel();
+ sigemptyset(&sig);
+ memset(&s, 0, sizeof(s));
+ io_uring_setup_queue(&s, QUEUE_DEPTH, 0);
+}
+
+static void cleanup(void)
+{
+ if (fd >= 0)
+ SAFE_CLOSE(fd);
+
+ io_uring_cleanup_queue(&s, QUEUE_DEPTH);
+}
+
+static struct tst_test test = {
+ .test_all = run,
+ .setup = setup,
+ .cleanup = cleanup,
+ .needs_tmpdir = 1,
+ .bufs = (struct tst_buffers []) {
+ {&write_iovs, .iov_sizes = (int[]){VEC_SIZE, VEC_SIZE,
+ VEC_SIZE, VEC_SIZE, -1}},
+ {&read_iovs, .iov_sizes = (int[]){VEC_SIZE, VEC_SIZE,
+ VEC_SIZE, VEC_SIZE, -1}},
+ {}
+ },
+ .save_restore = (const struct tst_path_val[]) {
+ {"/proc/sys/kernel/io_uring_disabled", "0",
+ TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+ {}
+ }
+};
Add new test case io_uring05.c to validate vectored I/O operations using partial vector sets with different file offsets. The test performs: - IORING_OP_WRITEV: Write first half using first 2 vectors at offset 0 - IORING_OP_WRITEV: Write second half using next 2 vectors at offset 2048 - IORING_OP_READV: Read entire file using all 4 vectors - Data integrity verification across all vectors This validates that io_uring correctly handles partial vector operations and maintains data integrity when using different vector subsets with specific file offsets. Signed-off-by: Sachin Sant <sachinp@linux.ibm.com> --- V2 changes: - Updated subject prefix to align with rest of the series - Declare fd as static with file scope. - Reset fd at the top of run(), and close it in cleanup() - Remove extra blank line from description - Link to v1 https://lore.kernel.org/ltp/20260506183750.97191-1-sachinp@linux.ibm.com/T/#t --- runtest/syscalls | 1 + testcases/kernel/syscalls/io_uring/.gitignore | 1 + .../kernel/syscalls/io_uring/io_uring05.c | 98 +++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 testcases/kernel/syscalls/io_uring/io_uring05.c