public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing] handle buffered writes in read-write test
@ 2022-08-15 17:09 Dylan Yudaken
  2022-08-15 17:12 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Yudaken @ 2022-08-15 17:09 UTC (permalink / raw)
  To: axboe, asml.silence; +Cc: io-uring, Kernel-team, Dylan Yudaken

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 <[email protected]>
---
 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


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

* Re: [PATCH liburing] handle buffered writes in read-write test
  2022-08-15 17:09 [PATCH liburing] handle buffered writes in read-write test Dylan Yudaken
@ 2022-08-15 17:12 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-08-15 17:12 UTC (permalink / raw)
  To: dylany, asml.silence; +Cc: Kernel-team, io-uring

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,
-- 
Jens Axboe



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

end of thread, other threads:[~2022-08-15 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-15 17:09 [PATCH liburing] handle buffered writes in read-write test Dylan Yudaken
2022-08-15 17:12 ` Jens Axboe

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