Skip to content

Commit 59850d2

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix io_cqring_events()'s noflush
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]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 634578f commit 59850d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ static unsigned io_cqring_events(struct io_ring_ctx *ctx, bool noflush)
23292329
* we wake up the task, and the next invocation will flush the
23302330
* entries. We cannot safely to it from here.
23312331
*/
2332-
if (noflush && !list_empty(&ctx->cq_overflow_list))
2332+
if (noflush)
23332333
return -1U;
23342334

23352335
io_cqring_overflow_flush(ctx, false, NULL, NULL);

0 commit comments

Comments
 (0)