diff options
author | Hao Xu <haoxu@linux.alibaba.com> | 2021-08-27 11:46:09 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-08-27 15:27:24 +0200 |
commit | a8295b982c46d4a7c259a4cdd58a2681929068a9 (patch) | |
tree | 355d0a213dbeee99690c97ba0984116288645322 /mm/highmem.c | |
parent | io_uring: remove redundant req_set_fail() (diff) | |
download | linux-a8295b982c46d4a7c259a4cdd58a2681929068a9.tar.xz linux-a8295b982c46d4a7c259a4cdd58a2681929068a9.zip |
io_uring: fix failed linkchain code logic
Given a linkchain like this:
req0(link_flag)-->req1(link_flag)-->...-->reqn(no link_flag)
There is a problem:
- if some intermediate linked req like req1 's submittion fails, reqs
after it won't be cancelled.
- sqpoll disabled: maybe it's ok since users can get the error info
of req1 and stop submitting the following sqes.
- sqpoll enabled: definitely a problem, the following sqes will be
submitted in the next round.
The solution is to refactor the code logic to:
- if a linked req's submittion fails, just mark it and the head(if it
exists) as REQ_F_FAIL. Leverage req->result to indicate whether it
is failed or cancelled.
- submit or fail the whole chain when we come to the end of it.
Signed-off-by: Hao Xu <haoxu@linux.alibaba.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/20210827094609.36052-3-haoxu@linux.alibaba.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'mm/highmem.c')
0 files changed, 0 insertions, 0 deletions