Skip to content

Commit 9b7adba

Browse files
committed
io_uring: add missing REQ_F_COMP_LOCKED for nested requests
When we traverse into failing links or timeouts, we need to ensure we propagate the REQ_F_COMP_LOCKED flag to ensure that we correctly signal to the completion side that we already hold the completion lock. Signed-off-by: Jens Axboe <[email protected]>
1 parent 7271ef3 commit 9b7adba

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

fs/io_uring.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ static bool __io_kill_linked_timeout(struct io_kiocb *req)
16091609
return false;
16101610

16111611
list_del_init(&link->link_list);
1612+
link->flags |= REQ_F_COMP_LOCKED;
16121613
wake_ev = io_link_cancel_timeout(link);
16131614
req->flags &= ~REQ_F_LINK_TIMEOUT;
16141615
return wake_ev;
@@ -1667,6 +1668,7 @@ static void __io_fail_links(struct io_kiocb *req)
16671668
trace_io_uring_fail_link(req, link);
16681669

16691670
io_cqring_fill_event(link, -ECANCELED);
1671+
link->flags |= REQ_F_COMP_LOCKED;
16701672
__io_double_put_req(link);
16711673
req->flags &= ~REQ_F_LINK_TIMEOUT;
16721674
}
@@ -5071,6 +5073,7 @@ static int io_timeout_cancel(struct io_ring_ctx *ctx, __u64 user_data)
50715073
return -EALREADY;
50725074

50735075
req_set_fail_links(req);
5076+
req->flags |= REQ_F_COMP_LOCKED;
50745077
io_cqring_fill_event(req, -ECANCELED);
50755078
io_put_req(req);
50765079
return 0;

0 commit comments

Comments
 (0)