public inbox for [email protected]
 help / color / mirror / Atom feed
From: Jens Axboe <[email protected]>
To: [email protected]
Cc: "Pavel Begunkov (Silence)" <[email protected]>
Subject: fixup for "io_uring: allocate io_kiocb upfront"
Date: Wed, 6 Nov 2019 20:20:14 -0700	[thread overview]
Message-ID: <[email protected]> (raw)

Pavel,

I didn't read this one closely enough for the latest change, we
can't just return -EAGAIN if we don't submit anything, we have to
explicitly do it for just the failure case of not getting a request.
I'm going to fold in this incremental:

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 951fd09612ec..af8a673c618f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2978,8 +2978,11 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr,
 		unsigned int sqe_flags;
 
 		req = io_get_req(ctx, statep);
-		if (unlikely(!req))
+		if (unlikely(!req)) {
+			if (!submitted)
+				submitted = -EAGAIN;
 			break;
+		}
 		if (!io_get_sqring(ctx, &req->submit)) {
 			__io_free_req(req);
 			break;
@@ -4316,8 +4319,6 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
 		cur_mm = ctx->sqo_mm;
 		submitted = io_submit_sqes(ctx, to_submit, f.file, fd,
 					   &cur_mm, false);
-		if (!submitted)
-			submitted = -EAGAIN;
 		mutex_unlock(&ctx->uring_lock);
 	}
 	if (flags & IORING_ENTER_GETEVENTS) {

-- 
Jens Axboe


             reply	other threads:[~2019-11-07  3:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-07  3:20 Jens Axboe [this message]
2019-11-07  9:24 ` fixup for "io_uring: allocate io_kiocb upfront" 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 \
    [email protected] \
    [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