summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-12-17 00:24:36 +0000
committerJens Axboe <axboe@kernel.dk>2020-12-17 08:40:52 -0700
commit9cd2be519d05ee78876d55e8e902b7125f78b74f (patch)
tree168cee3fc63b02695c84843c0ff24b8f82cfcdee /fs/io_uring.c
parentcda286f0715c82f8117e166afd42cca068876dde (diff)
downloadlinux-9cd2be519d05ee78876d55e8e902b7125f78b74f.tar.bz2
io_uring: remove racy overflow list fast checks
list_empty_careful() is not racy only if some conditions are met, i.e. no re-adds after del_init. io_cqring_overflow_flush() does list_move(), so it's actually racy. Remove those checks, we have ->cq_check_overflow for the fast path. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0d0217281ccf..fa3cf564ec06 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1724,8 +1724,6 @@ static bool io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool force,
LIST_HEAD(list);
if (!force) {
- if (list_empty_careful(&ctx->cq_overflow_list))
- return true;
if ((ctx->cached_cq_tail - READ_ONCE(rings->cq.head) ==
rings->cq_ring_entries))
return false;
@@ -6822,8 +6820,7 @@ static int io_submit_sqes(struct io_ring_ctx *ctx, unsigned int nr)
/* if we have a backlog and couldn't flush it all, return BUSY */
if (test_bit(0, &ctx->sq_check_overflow)) {
- if (!list_empty(&ctx->cq_overflow_list) &&
- !io_cqring_overflow_flush(ctx, false, NULL, NULL))
+ if (!io_cqring_overflow_flush(ctx, false, NULL, NULL))
return -EBUSY;
}