summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-02-20 09:59:02 -0700
committerJens Axboe <axboe@kernel.dk>2020-03-02 14:04:24 -0700
commite441d1cf20e1b9fc443e6130488d41e1941aae82 (patch)
tree259b527bc9adb7e3f6b6897bb3a870e1f9caae07 /fs/io_uring.c
parent29de5f6a350778a621a748cecc7efbb8f0cfa5a7 (diff)
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: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 64b4519aabf8..2bf954a42586 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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;