Skip to content
Commit 687b2bae authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: ensure deferred completions are flushed for multishot



Multishot normally uses io_req_post_cqe() to post completions, but when
stopping it, it may finish up with a deferred completion. This is fine,
except if another multishot event triggers before the deferred completions
get flushed. If this occurs, then CQEs may get reordered in the CQ ring,
as new multishot completions get posted before the deferred ones are
flushed. This can cause confusion on the application side, if strict
ordering is required for the use case.

When multishot posting via io_req_post_cqe(), flush any pending deferred
completions first, if any.

Cc: stable@vger.kernel.org # 6.1+
Reported-by: default avatarNorman Maurer <norman_maurer@apple.com>
Reported-by: default avatarChristian Mazakas <christian.mazakas@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b53e5232
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment