]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
io_uring: ensure deferred completions are posted for multishot
authorJens Axboe <axboe@kernel.dk>
Wed, 7 May 2025 14:07:09 +0000 (08:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 May 2025 06:21:25 +0000 (08:21 +0200)
commitb82c386898f7b00cb49abe3fbd622017aaa61230
treed588c5cd05c2c505c00c007672748f34a1184481
parent95b9acb0bb4ef616f4a8cfdfd416547cdd95d58d
io_uring: ensure deferred completions are posted for multishot

Commit 687b2bae0efff9b25e071737d6af5004e6e35af5 upstream.

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,
and cause confusion on the application side.

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: Norman Maurer <norman_maurer@apple.com>
Reported-by: Christian Mazakas <christian.mazakas@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/io_uring.c