[PATCH] io_uring: flush deferred completions for multishot CQE32 posting

Yang Xiuwei <[email protected]>
Newsgroups org.kernel.vger.io-uring
Message-ID <[email protected]>
io_req_post_cqe() flushes compl_reqs before posting multishot CQEs
since commit 687b2bae0eff ("io_uring: ensure deferred completions are
flushed for multishot").  Apply the same flush to io_req_post_cqe32()
so both multishot aux posting helpers behave consistently.

Signed-off-by: Yang Xiuwei <[email protected]>
---
 io_uring/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1ea2fca34a36..7f54d27cae94 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -900,6 +900,9 @@ bool io_req_post_cqe32(struct io_kiocb *req, struct io_uring_cqe cqe[2])
 	struct io_ring_ctx *ctx = req->ctx;
 	bool posted;
 
+	if (!wq_list_empty(&ctx->submit_state.compl_reqs))
+		__io_submit_flush_completions(ctx);
+
 	lockdep_assert(!io_wq_current_is_worker());
 	lockdep_assert_held(&ctx->uring_lock);
 
-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.