diff mbox series

[liburing] handle buffered writes in read-write test

Message ID 20220815170914.3094167-1-dylany@fb.com (mailing list archive)
State New
Headers show
Series [liburing] handle buffered writes in read-write test | expand

Commit Message

Dylan Yudaken Aug. 15, 2022, 5:09 p.m. UTC
When buffered writes are used then two things change:
1 - signals will propogate to the submit() call (as they would be
effectively ignored when going async)
2 - CQE ordering will change

Fix the read-write for both of these cases by ignoring the signal and
handling CQE ordering.

Signed-off-by: Dylan Yudaken <dylany@fb.com>
---
 test/read-write.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


base-commit: 15cc446cb8b0caa5c939423d31182eba66141539

Comments

Jens Axboe Aug. 15, 2022, 5:12 p.m. UTC | #1
On Mon, 15 Aug 2022 10:09:14 -0700, Dylan Yudaken wrote:
> When buffered writes are used then two things change:
> 1 - signals will propogate to the submit() call (as they would be
> effectively ignored when going async)
> 2 - CQE ordering will change
> 
> Fix the read-write for both of these cases by ignoring the signal and
> handling CQE ordering.
> 
> [...]

Applied, thanks!

[1/1] handle buffered writes in read-write test
      commit: 9adc7ddb158e773c48e25aa1fab7f9f6912a458e

Best regards,
diff mbox series

Patch

diff --git a/test/read-write.c b/test/read-write.c
index c5cc469f258d..f50e8242afa4 100644
--- a/test/read-write.c
+++ b/test/read-write.c
@@ -759,6 +759,7 @@  static int test_write_efbig(void)
 			goto err;
 		}
 		io_uring_prep_writev(sqe, fd, &vecs[i], 1, off);
+		io_uring_sqe_set_data64(sqe, i);
 		off += BS;
 	}
 
@@ -774,7 +775,7 @@  static int test_write_efbig(void)
 			fprintf(stderr, "wait_cqe=%d\n", ret);
 			goto err;
 		}
-		if (i < 16) {
+		if (cqe->user_data < 16) {
 			if (cqe->res != BS) {
 				fprintf(stderr, "bad write: %d\n", cqe->res);
 				goto err;
@@ -819,6 +820,8 @@  int main(int argc, char *argv[])
 		t_create_file(fname, FILE_SIZE);
 	}
 
+	signal(SIGXFSZ, SIG_IGN);
+
 	vecs = t_create_buffers(BUFFERS, BS);
 
 	/* if we don't have nonvec read, skip testing that */