public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing] test: don't expect links to be partially executed
@ 2021-02-18 18:30 Pavel Begunkov
  2021-02-18 20:13 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2021-02-18 18:30 UTC (permalink / raw)
  To: Jens Axboe, io-uring

When we link a buggy request, the whole link collected by that moment
may be cancelled even before it got issued. Don't expect it to be
partially executed.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 test/register-restrictions.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/test/register-restrictions.c b/test/register-restrictions.c
index 04a0ed9..bcae67c 100644
--- a/test/register-restrictions.c
+++ b/test/register-restrictions.c
@@ -351,13 +351,19 @@ static int test_restrictions_flags(void)
 	io_uring_sqe_set_flags(sqe, IOSQE_FIXED_FILE | IOSQE_IO_LINK);
 	sqe->user_data = 3;
 
+	ret = io_uring_submit(&ring);
+	if (ret != 3) {
+		fprintf(stderr, "submit: %d\n", ret);
+		return TEST_FAILED;
+	}
+
 	sqe = io_uring_get_sqe(&ring);
 	io_uring_prep_writev(sqe, 1, &vec, 1, 0);
 	io_uring_sqe_set_flags(sqe, IOSQE_FIXED_FILE | IOSQE_IO_DRAIN);
 	sqe->user_data = 4;
 
 	ret = io_uring_submit(&ring);
-	if (ret != 4) {
+	if (ret != 1) {
 		fprintf(stderr, "submit: %d\n", ret);
 		return TEST_FAILED;
 	}
-- 
2.24.0


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

* Re: [PATCH liburing] test: don't expect links to be partially executed
  2021-02-18 18:30 [PATCH liburing] test: don't expect links to be partially executed Pavel Begunkov
@ 2021-02-18 20:13 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-02-18 20:13 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 2/18/21 11:30 AM, Pavel Begunkov wrote:
> When we link a buggy request, the whole link collected by that moment
> may be cancelled even before it got issued. Don't expect it to be
> partially executed.

Applied, thanks.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-02-18 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-18 18:30 [PATCH liburing] test: don't expect links to be partially executed Pavel Begunkov
2021-02-18 20:13 ` Jens Axboe

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