io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fixup for "io_uring: allocate io_kiocb upfront"
@ 2019-11-07  3:20 Jens Axboe
  2019-11-07  9:24 ` Pavel Begunkov
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2019-11-07  3:20 UTC (permalink / raw)
  To: io-uring; +Cc: Pavel Begunkov (Silence)

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


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

end of thread, other threads:[~2019-11-07  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07  3:20 fixup for "io_uring: allocate io_kiocb upfront" Jens Axboe
2019-11-07  9:24 ` Pavel Begunkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).