Commit d3b35796 authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: break links for failed defer

If io_req_defer() failed, it needs to cancel a dependant link.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b2e9c7d6
...@@ -2958,6 +2958,8 @@ static void io_queue_sqe(struct io_kiocb *req) ...@@ -2958,6 +2958,8 @@ static void io_queue_sqe(struct io_kiocb *req)
if (ret) { if (ret) {
if (ret != -EIOCBQUEUED) { if (ret != -EIOCBQUEUED) {
io_cqring_add_event(req, ret); io_cqring_add_event(req, ret);
if (req->flags & REQ_F_LINK)
req->flags |= REQ_F_FAIL_LINK;
io_double_put_req(req); io_double_put_req(req);
} }
} else } else
...@@ -2990,6 +2992,8 @@ static void io_queue_link_head(struct io_kiocb *req, struct io_kiocb *shadow) ...@@ -2990,6 +2992,8 @@ static void io_queue_link_head(struct io_kiocb *req, struct io_kiocb *shadow)
if (ret != -EIOCBQUEUED) { if (ret != -EIOCBQUEUED) {
err: err:
io_cqring_add_event(req, ret); io_cqring_add_event(req, ret);
if (req->flags & REQ_F_LINK)
req->flags |= REQ_F_FAIL_LINK;
io_double_put_req(req); io_double_put_req(req);
if (shadow) if (shadow)
__io_free_req(shadow); __io_free_req(shadow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment