From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Cc: [email protected]
Subject: [PATCH 5.10 4/5] io_uring: fix io_cqring_events()'s noflush
Date: Sun, 6 Dec 2020 22:22:45 +0000 [thread overview]
Message-ID: <018bb0de66981fa798da015a983e5bb6c41bae5b.1607293068.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Checking !list_empty(&ctx->cq_overflow_list) around noflush in
io_cqring_events() is racy, because if it fails but a request overflowed
just after that, io_cqring_overflow_flush() still will be called.
Remove the second check, it shouldn't be a problem for performance,
because there is cq_check_overflow bit check just above.
Cc: <[email protected]> # 5.5+
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index b1ba9a738315..f707caed9f79 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2246,7 +2246,7 @@ static unsigned io_cqring_events(struct io_ring_ctx *ctx, bool noflush)
* we wake up the task, and the next invocation will flush the
* entries. We cannot safely to it from here.
*/
- if (noflush && !list_empty(&ctx->cq_overflow_list))
+ if (noflush)
return -1U;
io_cqring_overflow_flush(ctx, false, NULL, NULL);
--
2.24.0
next prev parent reply other threads:[~2020-12-06 22:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-06 22:22 [PATCH 5.10 0/5] iopoll fixes Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 1/5] io_uring: always let io_iopoll_complete() complete polled io Pavel Begunkov
2020-12-07 16:28 ` Jens Axboe
2020-12-08 19:12 ` Pavel Begunkov
2020-12-08 19:17 ` Jens Axboe
2020-12-08 19:24 ` Pavel Begunkov
2020-12-08 21:10 ` Jens Axboe
2020-12-09 20:17 ` Pavel Begunkov
2020-12-10 17:38 ` Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 2/5] io_uring: fix racy IOPOLL completions Pavel Begunkov
2020-12-07 18:31 ` Pavel Begunkov
2020-12-06 22:22 ` [PATCH 5.10 3/5] io_uring: fix racy IOPOLL flush overflow Pavel Begunkov
2020-12-06 22:22 ` Pavel Begunkov [this message]
2020-12-06 22:22 ` [PATCH 5.10 5/5] io_uring: fix mis-seting personality's creds Pavel Begunkov
2020-12-07 15:05 ` [PATCH 5.10 0/5] iopoll fixes Jens Axboe
2020-12-07 15:24 ` Pavel Begunkov
2020-12-07 15:28 ` Jens Axboe
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=018bb0de66981fa798da015a983e5bb6c41bae5b.1607293068.git.asml.silence@gmail.com \
[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