提交 e441d1cf 编写于 作者: J Jens Axboe

io_uring: io_accept() should hold on to submit reference on retry

Don't drop an early reference, hang on to it and let the caller drop
it. This makes it behave more like "regular" requests.
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 29de5f6a
......@@ -3354,6 +3354,8 @@ static void io_accept_finish(struct io_wq_work **workptr)
struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
struct io_kiocb *nxt = NULL;
io_put_req(req);
if (io_req_cancelled(req))
return;
__io_accept(req, &nxt, false);
......@@ -3371,7 +3373,6 @@ static int io_accept(struct io_kiocb *req, struct io_kiocb **nxt,
ret = __io_accept(req, nxt, force_nonblock);
if (ret == -EAGAIN && force_nonblock) {
req->work.func = io_accept_finish;
io_put_req(req);
return -EAGAIN;
}
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册