[PATCH liburing] handle buffered writes in read-write test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxx>
---
 test/read-write.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 */

base-commit: 15cc446cb8b0caa5c939423d31182eba66141539
-- 
2.30.2





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux