提交 528d1ef6 编写于 作者: P Pavel Begunkov 提交者: Cheng Jian

io_uring: break links for failed defer

mainline inclusion
from mainline-5.5-rc1
commit d3b35796
category: feature
bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27
CVE: NA
---------------------------

If io_req_defer() failed, it needs to cancel a dependant link.
Signed-off-by: NPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Nyangerkun <yangerkun@huawei.com>
Reviewed-by: Nzhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 9034256c
...@@ -2957,6 +2957,8 @@ static void io_queue_sqe(struct io_kiocb *req) ...@@ -2957,6 +2957,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
...@@ -2989,6 +2991,8 @@ static void io_queue_link_head(struct io_kiocb *req, struct io_kiocb *shadow) ...@@ -2989,6 +2991,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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册