Skip to content

Commit 1ef1899

Browse files
author
CKI KWF Bot
committed
Merge: io_uring: ensure deferred completions are flushed for multishot
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/1184 JIRA: https://issues.redhat.com/browse/RHEL-102863 This pulls in a targeted bug fix for a customer. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Approved-by: Brian Foster <bfoster@redhat.com> Approved-by: Ewan D. Milne <emilne@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents f81172e + 983aeac commit 1ef1899

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

io_uring/io_uring.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,14 @@ bool io_req_post_cqe(struct io_kiocb *req, s32 res, u32 cflags)
880880
struct io_ring_ctx *ctx = req->ctx;
881881
bool posted;
882882

883+
/*
884+
* If multishot has already posted deferred completions, ensure that
885+
* those are flushed first before posting this one. If not, CQEs
886+
* could get reordered.
887+
*/
888+
if (!wq_list_empty(&ctx->submit_state.compl_reqs))
889+
__io_submit_flush_completions(ctx);
890+
883891
lockdep_assert(!io_wq_current_is_worker());
884892
lockdep_assert_held(&ctx->uring_lock);
885893

0 commit comments

Comments
 (0)