public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH liburing] test/lfs-open: less limited test_drained_files
Date: Mon, 19 Oct 2020 16:46:11 +0100	[thread overview]
Message-ID: <d6fd0e761f9daafcd4a8092117dfd751c94f2a06.1603122173.git.asml.silence@gmail.com> (raw)

close(dup(io_uring)) should not neccessary cancel all requests with
files, because files are not yet going away. Test that it doesn't hang
after close() and exits, that's enough.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 test/lfs-openat.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/test/lfs-openat.c b/test/lfs-openat.c
index 921e2a1..3fa0b99 100644
--- a/test/lfs-openat.c
+++ b/test/lfs-openat.c
@@ -202,18 +202,11 @@ static int test_drained_files(int dfd, const char *fn, bool linked, bool prepend
 		return 1;
 	}
 
-	/* io_uring->flush() */
+	/*
+	 * close(), which triggers ->flush(), and io_uring_queue_exit()
+	 * should successfully return and not hang.
+	 */
 	close(fd);
-
-	for (i = 0; i < to_cancel; i++) {
-		ret = io_uring_wait_cqe(&ring, &cqe);
-		if (cqe->res != -ECANCELED) {
-			fprintf(stderr, "fail cqe->res=%d\n", cqe->res);
-			return 1;
-		}
-		io_uring_cqe_seen(&ring, cqe);
-	}
-
 	io_uring_queue_exit(&ring);
 	return 0;
 }
-- 
2.24.0


             reply	other threads:[~2020-10-19 15:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 15:46 Pavel Begunkov [this message]
2020-10-20 14:12 ` [PATCH liburing] test/lfs-open: less limited test_drained_files Jens Axboe
2020-10-20 16:15   ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6fd0e761f9daafcd4a8092117dfd751c94f2a06.1603122173.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox