* [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations
@ 2026-05-06 18:37 Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 2/4] syscalls/io_uring: Add test for partial vector operations Sachin Sant
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Sachin Sant @ 2026-05-06 18:37 UTC (permalink / raw)
To: ltp
Add new test case io_uring04.c to validate IORING_OP_READV and
IORING_OP_WRITEV operations with uniform buffer sizes.
Test performs:
- Vectored write using multiple uniform buffers (4 x 1024 bytes)
- Vectored read back into multiple uniform buffers
- Data integrity verification across all vectors
Also add helper functions to io_uring_common.h:
- io_uring_init_iovec_pattern(): Initialize iovec buffers with patterns
- io_uring_clear_iovec(): Clear iovec buffers by zeroing data
- io_uring_verify_iovec(): Verify data integrity between write/read iovecs
Update runtest/syscalls and .gitignore to include the new test.
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
V6 changes:
- Split io_uring04.c into 3 independent tests
- Linux to v5 https://lore.kernel.org/ltp/69fb33a1.5d0a0220.337e29.6038@mx.google.com/T/#t
V5 changes:
- Add clear_iovec_buffers() at the top of run()
- Link to v4 https://lore.kernel.org/ltp/20260416062302.15804-1-sachinp@linux.ibm.com/T/
V4 changes:
- Updated commit message to remove references to non-existent function
- Removed extra blank line before test_writev_readv()
- Link to v3 https://lore.kernel.org/ltp/20260416042531.81093-1-sachinp@linux.ibm.com/T/
V3 changes (2/3 io_uring04 only):
- 1/3 and 3/3 from the patch series already merged.
- Merged prepare_read_buffers() and clear_iovec_buffers() into
single clear_iovec_buffers() function
- Merged io_uring_init_buffer_pattern() into unified
init_iovec_buffers() function that supports both rotating and
simple character patterns
- Removed io_uring_init_buffer_pattern() from io_uring_common.h as it's
only used in io_uring04.c
- Link to V2: https://lore.kernel.org/ltp/b4653e3f-ac9b-4a24-8d3f-51677c488e8c@linux.ibm.com/T/
V2 changes:
- Use guarded buffer(including iovec) allocation
- Move setup/cleanup code from run to appropriate path
- Add a function to map the OP to the enum name
- Define and use generic cleanup functions
- Add a buffer size 0 in the middle of the iovec
- Simplify setup_io_uring_test to use common code.
- Link to V1: https://lore.kernel.org/ltp/20260320124742.75946-1-sachinp@linux.ibm.com/T/#t
Changes after RFC patch series:
- Addressed review comments
- Refactored io_uring01 test to use common code
- Removed git tags
- Link to RFC: https://lore.kernel.org/ltp/20260318110328.52031-1-sachinp@linux.ibm.com/T/#t
---
runtest/syscalls | 1 +
testcases/kernel/syscalls/io_uring/.gitignore | 1 +
.../kernel/syscalls/io_uring/io_uring04.c | 84 ++++++++++++++++++
.../syscalls/io_uring/io_uring_common.h | 86 +++++++++++++++++++
4 files changed, 172 insertions(+)
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring04.c
diff --git a/runtest/syscalls b/runtest/syscalls
index f790e8f84..6b047b5fd 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1904,6 +1904,7 @@ membarrier01 membarrier01
io_uring01 io_uring01
io_uring02 io_uring02
io_uring03 io_uring03
+io_uring04 io_uring04
# Tests below may cause kernel memory leak
perf_event_open03 perf_event_open03
diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
index 9382ae413..36cd24662 100644
--- a/testcases/kernel/syscalls/io_uring/.gitignore
+++ b/testcases/kernel/syscalls/io_uring/.gitignore
@@ -1,3 +1,4 @@
/io_uring01
/io_uring02
/io_uring03
+/io_uring04
diff --git a/testcases/kernel/syscalls/io_uring/io_uring04.c b/testcases/kernel/syscalls/io_uring/io_uring04.c
new file mode 100644
index 000000000..8361b5df0
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring04.c
@@ -0,0 +1,84 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ */
+/*\
+ * Test basic IORING_OP_READV and IORING_OP_WRITEV operations.
+ *
+ * This test validates basic vectored read and write operations using
+ * io_uring with uniform buffer sizes. It performs:
+ * 1. IORING_OP_WRITEV - Writing data using multiple uniform buffers
+ * 2. IORING_OP_READV - Reading data back into multiple uniform buffers
+ * 3. 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 void run(void)
+{
+ int fd = -1;
+ int total_size = NUM_VECS * VEC_SIZE;
+
+ 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 %d bytes using %d vectors",
+ total_size, NUM_VECS);
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_WRITEV, write_iovs, NUM_VECS,
+ 0, total_size, &sig);
+
+ SAFE_FSYNC(fd);
+
+ tst_res(TINFO, "Reading %d bytes using %d vectors",
+ total_size, NUM_VECS);
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_READV, read_iovs, NUM_VECS,
+ 0, total_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)
+{
+ 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},
+ {}
+ }
+};
diff --git a/testcases/kernel/syscalls/io_uring/io_uring_common.h b/testcases/kernel/syscalls/io_uring/io_uring_common.h
index aa31339fb..523f686f8 100644
--- a/testcases/kernel/syscalls/io_uring/io_uring_common.h
+++ b/testcases/kernel/syscalls/io_uring/io_uring_common.h
@@ -275,4 +275,90 @@ static inline void io_uring_do_vec_io_op(struct io_uring_submit *s, int fd,
expected_size);
}
+/*
+ * Initialize iovec buffers with pattern
+ * @iovs: array of iovec structures
+ * @nvecs: number of iovecs
+ * @base_char: base character for pattern (must be 'A'-'Z')
+ * @use_rotating: if non-zero, use rotating pattern; if zero, use simple repeat
+ */
+static inline void io_uring_init_iovec_pattern(struct iovec *iovs, int nvecs,
+ char base_char, int use_rotating)
+{
+ int i;
+ size_t j;
+ char *buf;
+
+ if (base_char < 'A' || base_char > 'Z')
+ tst_brk(TBROK, "base_char must be 'A'-'Z', got '%c'",
+ base_char);
+
+ for (i = 0; i < nvecs; i++) {
+ if (iovs[i].iov_len == 0)
+ continue;
+
+ buf = (char *)iovs[i].iov_base;
+ if (use_rotating) {
+ /* Each vector has a different rotating pattern */
+ for (j = 0; j < iovs[i].iov_len; j++)
+ buf[j] = 'A' + ((base_char - 'A' + i + j) % 26);
+ } else {
+ for (j = 0; j < iovs[i].iov_len; j++)
+ buf[j] = 'A' + ((base_char - 'A' + i) % 26);
+ }
+ }
+}
+
+/*
+ * Clear iovec buffers by zeroing all data
+ */
+static inline void io_uring_clear_iovec(struct iovec *iovs, int nvecs)
+{
+ int i;
+
+ for (i = 0; i < nvecs; i++)
+ memset(iovs[i].iov_base, 0, iovs[i].iov_len);
+}
+
+/*
+ * Verify data integrity between write and read iovecs
+ * Stops test execution on verification failure
+ */
+static inline void io_uring_verify_iovec(struct iovec *write_iovs,
+ struct iovec *read_iovs, int nvecs)
+{
+ int i;
+ size_t j;
+
+ for (i = 0; i < nvecs; i++) {
+ if (write_iovs[i].iov_len != read_iovs[i].iov_len) {
+ tst_brk(TFAIL,
+ "iovec %d length mismatch: write=%zu read=%zu",
+ i, write_iovs[i].iov_len, read_iovs[i].iov_len);
+ }
+
+ if (memcmp(write_iovs[i].iov_base, read_iovs[i].iov_base,
+ write_iovs[i].iov_len) != 0) {
+ for (j = 0; j < write_iovs[i].iov_len; j++) {
+ char *wbuf = (char *)write_iovs[i].iov_base;
+ char *rbuf = (char *)read_iovs[i].iov_base;
+
+ if (wbuf[j] != rbuf[j]) {
+ tst_res(TINFO,
+ "Vector %d: first mismatch at "
+ "offset %zu: wrote 0x%02x, "
+ "read 0x%02x",
+ i, j,
+ (unsigned char)wbuf[j],
+ (unsigned char)rbuf[j]);
+ break;
+ }
+ }
+ tst_brk(TFAIL, "data mismatch in vector %d", i);
+ }
+ }
+
+ tst_res(TPASS, "data integrity verified across %d vectors", nvecs);
+}
+
#endif /* IO_URING_COMMON_H */
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread* [LTP] [PATCH 2/4] syscalls/io_uring: Add test for partial vector operations
2026-05-06 18:37 [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations Sachin Sant
@ 2026-05-06 18:37 ` Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 3/4] io_uring: Add test for varying buffer sizes with zero-length buffer Sachin Sant
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2026-05-06 18:37 UTC (permalink / raw)
To: ltp
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>
---
runtest/syscalls | 1 +
testcases/kernel/syscalls/io_uring/.gitignore | 1 +
.../kernel/syscalls/io_uring/io_uring05.c | 94 +++++++++++++++++++
3 files changed, 96 insertions(+)
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring05.c
diff --git a/runtest/syscalls b/runtest/syscalls
index 6b047b5fd..bab0e8f3b 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -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
diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
index 36cd24662..bce7048cd 100644
--- a/testcases/kernel/syscalls/io_uring/.gitignore
+++ b/testcases/kernel/syscalls/io_uring/.gitignore
@@ -2,3 +2,4 @@
/io_uring02
/io_uring03
/io_uring04
+/io_uring05
diff --git a/testcases/kernel/syscalls/io_uring/io_uring05.c b/testcases/kernel/syscalls/io_uring/io_uring05.c
new file mode 100644
index 000000000..ded990c41
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring05.c
@@ -0,0 +1,94 @@
+// 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 void run(void)
+{
+ int fd = -1;
+ int half_size = 2 * VEC_SIZE;
+
+ 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)
+{
+ 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},
+ {}
+ }
+};
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread* [LTP] [PATCH 3/4] io_uring: Add test for varying buffer sizes with zero-length buffer
2026-05-06 18:37 [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 2/4] syscalls/io_uring: Add test for partial vector operations Sachin Sant
@ 2026-05-06 18:37 ` Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 4/4] io_uring: remove unused io_uring_init_buffer_pattern() Sachin Sant
2026-05-06 20:28 ` [LTP] io_uring: Add io_uring04 test for vectored I/O operations linuxtestproject.agent
3 siblings, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2026-05-06 18:37 UTC (permalink / raw)
To: ltp
Add io_uring06 test to validate vectored I/O operations (IORING_OP_READV
and IORING_OP_WRITEV) with non-uniform buffer sizes including a
zero-length buffer.
The test verifies:
- Writing data using iovec with varying sizes (512, 0, 1024, 256 bytes)
- Reading data back into buffers of the same varying sizes
- Data integrity verification with zero-length buffer handling
- Proper handling of iovec arrays with mixed buffer sizes
This test ensures the kernel correctly handles zero-length buffers in
vectored I/O operations, which is important for applications that may
dynamically construct iovec arrays.
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
runtest/syscalls | 1 +
testcases/kernel/syscalls/io_uring/.gitignore | 1 +
.../kernel/syscalls/io_uring/io_uring06.c | 97 +++++++++++++++++++
3 files changed, 99 insertions(+)
create mode 100644 testcases/kernel/syscalls/io_uring/io_uring06.c
diff --git a/runtest/syscalls b/runtest/syscalls
index bab0e8f3b..fc4892221 100644
--- a/runtest/syscalls
+++ b/runtest/syscalls
@@ -1906,6 +1906,7 @@ io_uring02 io_uring02
io_uring03 io_uring03
io_uring04 io_uring04
io_uring05 io_uring05
+io_uring06 io_uring06
# Tests below may cause kernel memory leak
perf_event_open03 perf_event_open03
diff --git a/testcases/kernel/syscalls/io_uring/.gitignore b/testcases/kernel/syscalls/io_uring/.gitignore
index bce7048cd..dfe7cca5a 100644
--- a/testcases/kernel/syscalls/io_uring/.gitignore
+++ b/testcases/kernel/syscalls/io_uring/.gitignore
@@ -3,3 +3,4 @@
/io_uring03
/io_uring04
/io_uring05
+/io_uring06
diff --git a/testcases/kernel/syscalls/io_uring/io_uring06.c b/testcases/kernel/syscalls/io_uring/io_uring06.c
new file mode 100644
index 000000000..82e47a4e4
--- /dev/null
+++ b/testcases/kernel/syscalls/io_uring/io_uring06.c
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 IBM
+ * Author: Sachin Sant <sachinp@linux.ibm.com>
+ */
+/*\
+ *
+ * Test varying buffer sizes including zero-length buffers with
+ * IORING_OP_READV and IORING_OP_WRITEV.
+ *
+ * This test validates vectored I/O operations with non-uniform buffer
+ * sizes including a zero-length buffer. It tests:
+ * 1. IORING_OP_WRITEV - Writing data using buffers of varying sizes
+ * (512, 0, 1024, 256 bytes)
+ * 2. IORING_OP_READV - Reading data into buffers of varying sizes
+ * 3. Data integrity verification with zero-length buffer handling
+ * 4. Proper handling of iovec arrays with mixed buffer sizes
+ */
+
+#include "io_uring_common.h"
+
+#define TEST_FILE "io_uring_test_file"
+#define QUEUE_DEPTH 2
+#define NUM_VECS 4
+#define VAR_BUF1_SIZE 512
+#define VAR_BUF2_SIZE 1024
+#define VAR_BUF3_SIZE 256
+
+static struct iovec *write_iovs, *read_iovs;
+static struct io_uring_submit s;
+static sigset_t sig;
+
+static void run(void)
+{
+ int fd = -1;
+ int expected_size = VAR_BUF1_SIZE + VAR_BUF2_SIZE + VAR_BUF3_SIZE;
+
+ tst_res(TINFO,
+ "Testing vectors with varying sizes including zero-length buffer");
+
+ io_uring_init_iovec_pattern(write_iovs, NUM_VECS, 'X', 0);
+ io_uring_clear_iovec(read_iovs, NUM_VECS);
+
+ fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
+
+ tst_res(TINFO,
+ "Writing %d bytes using buffers of sizes: 512, 0, 1024, 256",
+ expected_size);
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_WRITEV, write_iovs, NUM_VECS,
+ 0, expected_size, &sig);
+
+ SAFE_FSYNC(fd);
+
+ tst_res(TINFO,
+ "Reading %d bytes using buffers of sizes: 512, 0, 1024, 256",
+ expected_size);
+ io_uring_do_vec_io_op(&s, fd, IORING_OP_READV, read_iovs, NUM_VECS, 0,
+ expected_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)
+{
+ 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[]){VAR_BUF1_SIZE, 0,
+ VAR_BUF2_SIZE,
+ VAR_BUF3_SIZE, -1}},
+ {&read_iovs, .iov_sizes = (int[]){VAR_BUF1_SIZE, 0,
+ VAR_BUF2_SIZE,
+ VAR_BUF3_SIZE, -1}},
+ {}
+ },
+ .save_restore = (const struct tst_path_val[]) {
+ {"/proc/sys/kernel/io_uring_disabled", "0",
+ TST_SR_SKIP_MISSING | TST_SR_TCONF_RO},
+ {}
+ }
+};
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread* [LTP] [PATCH 4/4] io_uring: remove unused io_uring_init_buffer_pattern()
2026-05-06 18:37 [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 2/4] syscalls/io_uring: Add test for partial vector operations Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 3/4] io_uring: Add test for varying buffer sizes with zero-length buffer Sachin Sant
@ 2026-05-06 18:37 ` Sachin Sant
2026-05-06 20:28 ` [LTP] io_uring: Add io_uring04 test for vectored I/O operations linuxtestproject.agent
3 siblings, 0 replies; 5+ messages in thread
From: Sachin Sant @ 2026-05-06 18:37 UTC (permalink / raw)
To: ltp
The io_uring04 test merged the functionality of
io_uring_init_buffer_pattern() into the unified function
io_uring_init_iovec_buffers(). Since io_uring_init_buffer_pattern()
is not used by any existing test, remove it.
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
.../kernel/syscalls/io_uring/io_uring_common.h | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/testcases/kernel/syscalls/io_uring/io_uring_common.h b/testcases/kernel/syscalls/io_uring/io_uring_common.h
index 523f686f8..84f93c7b1 100644
--- a/testcases/kernel/syscalls/io_uring/io_uring_common.h
+++ b/testcases/kernel/syscalls/io_uring/io_uring_common.h
@@ -230,19 +230,6 @@ static inline void io_uring_wait_cqe(struct io_uring_submit *s,
*cring->head = head + 1;
}
-/*
- * Initialize buffer with a repeating character pattern
- * Useful for creating test data with predictable patterns
- */
-static inline void io_uring_init_buffer_pattern(char *buf, size_t size,
- char pattern)
-{
- size_t i;
-
- for (i = 0; i < size; i++)
- buf[i] = pattern;
-}
-
/*
* Submit and wait for a non-vectored I/O operation
* Combines io_uring_submit_sqe() and io_uring_wait_cqe() with result reporting
--
2.39.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [LTP] io_uring: Add io_uring04 test for vectored I/O operations
2026-05-06 18:37 [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations Sachin Sant
` (2 preceding siblings ...)
2026-05-06 18:37 ` [LTP] [PATCH 4/4] io_uring: remove unused io_uring_init_buffer_pattern() Sachin Sant
@ 2026-05-06 20:28 ` linuxtestproject.agent
3 siblings, 0 replies; 5+ messages in thread
From: linuxtestproject.agent @ 2026-05-06 20:28 UTC (permalink / raw)
To: Sachin Sant; +Cc: ltp
Hi Sachin,
--- [PATCH 2/4] ---
On Thu, 07 May 2026, Sachin Sant wrote:
> syscalls/io_uring: Add test for partial vector operations
Nit: the subject prefix "syscalls/io_uring:" should be "io_uring:" to
match the rest of the series.
--- [PATCH 4/4] ---
On Thu, 07 May 2026, Sachin Sant wrote:
> io_uring: remove unused io_uring_init_buffer_pattern()
> The io_uring04 test merged the functionality of
> io_uring_init_buffer_pattern() into the unified function
> io_uring_init_iovec_buffers().
The function name is wrong here. The replacement function introduced in
this series is io_uring_init_iovec_pattern(), not
io_uring_init_iovec_buffers() (which does not exist).
--- [PATCH 1/4, 2/4, 3/4] ---
On Thu, 07 May 2026, Sachin Sant wrote:
> +static void run(void)
> +{
> + int fd = -1;
> + ...
> + fd = SAFE_OPEN(TEST_FILE, O_RDWR | O_CREAT | O_TRUNC, 0644);
fd is a local variable; if tst_brk() fires between SAFE_OPEN and
SAFE_CLOSE (e.g. inside io_uring_do_vec_io_op or SAFE_FSYNC),
cleanup() has no reference to it and cannot close it. Declare fd as
static int fd = -1 at file scope, reset it at the top of run(), and
close it in cleanup() if >= 0. Applies to all three new test files.
> +/*\
> + *
> + * Test partial vector operations with IORING_OP_READV and IORING_OP_WRITEV.
(io_uring05.c, io_uring06.c) Extra blank line after /*\; the description
must start on the very next line. See io_uring04.c for the correct style.
---
Note:
Our agent completed the review of the patch. The full review can be
found at: https://github.com/linux-test-project/ltp-agent/actions/runs/25458989491
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] 5+ messages in thread
end of thread, other threads:[~2026-05-06 20:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-06 18:37 [LTP] [PATCH v7 1/4] io_uring: Add io_uring04 test for vectored I/O operations Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 2/4] syscalls/io_uring: Add test for partial vector operations Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 3/4] io_uring: Add test for varying buffer sizes with zero-length buffer Sachin Sant
2026-05-06 18:37 ` [LTP] [PATCH 4/4] io_uring: remove unused io_uring_init_buffer_pattern() Sachin Sant
2026-05-06 20:28 ` [LTP] io_uring: Add io_uring04 test for vectored I/O operations linuxtestproject.agent
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox