diff options
author | Hao Xu <haoxu@linux.alibaba.com> | 2021-09-22 12:12:37 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-09-24 18:24:34 +0200 |
commit | a62682f92eedb41c1cd8290fa875a4b85624fb9a (patch) | |
tree | d811877c89c57d09ae0df8ed0f92939d559bde74 /fs | |
parent | io_uring: fix race between poll completion and cancel_hash insertion (diff) | |
download | linux-a62682f92eedb41c1cd8290fa875a4b85624fb9a.tar.xz linux-a62682f92eedb41c1cd8290fa875a4b85624fb9a.zip |
io_uring: fix missing set of EPOLLONESHOT for CQ ring overflow
We should set EPOLLONESHOT if cqring_fill_event() returns false since
io_poll_add() decides to put req or not by it.
Fixes: 5082620fb2ca ("io_uring: terminate multishot poll for CQ ring overflow")
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20210922101238.7177-3-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 43530aae6180..ac0c06d5c629 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -5337,8 +5337,10 @@ static bool __io_poll_complete(struct io_kiocb *req, __poll_t mask) } if (req->poll.events & EPOLLONESHOT) flags = 0; - if (!io_cqring_fill_event(ctx, req->user_data, error, flags)) + if (!io_cqring_fill_event(ctx, req->user_data, error, flags)) { + req->poll.events |= EPOLLONESHOT; flags = 0; + } if (flags & IORING_CQE_F_MORE) ctx->cq_extra++; |