io_uring: fix lost cqe->flags
Don't forget to fill cqe->flags properly in io_submit_flush_completions()
Fixes: a1d7c393c4 ("io_uring: enable READ/WRITE to use deferred completions")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
652532ad45
commit
8b3656af2a
@@ -1416,7 +1416,7 @@ static void io_submit_flush_completions(struct io_comp_state *cs)
|
|||||||
|
|
||||||
req = list_first_entry(&cs->list, struct io_kiocb, list);
|
req = list_first_entry(&cs->list, struct io_kiocb, list);
|
||||||
list_del(&req->list);
|
list_del(&req->list);
|
||||||
io_cqring_fill_event(req, req->result);
|
__io_cqring_fill_event(req, req->result, req->cflags);
|
||||||
if (!(req->flags & REQ_F_LINK_HEAD)) {
|
if (!(req->flags & REQ_F_LINK_HEAD)) {
|
||||||
req->flags |= REQ_F_COMP_LOCKED;
|
req->flags |= REQ_F_COMP_LOCKED;
|
||||||
io_put_req(req);
|
io_put_req(req);
|
||||||
@@ -1441,6 +1441,7 @@ static void __io_req_complete(struct io_kiocb *req, long res, unsigned cflags,
|
|||||||
io_put_req(req);
|
io_put_req(req);
|
||||||
} else {
|
} else {
|
||||||
req->result = res;
|
req->result = res;
|
||||||
|
req->cflags = cflags;
|
||||||
list_add_tail(&req->list, &cs->list);
|
list_add_tail(&req->list, &cs->list);
|
||||||
if (++cs->nr >= 32)
|
if (++cs->nr >= 32)
|
||||||
io_submit_flush_completions(cs);
|
io_submit_flush_completions(cs);
|
||||||
|
|||||||
Reference in New Issue
Block a user