Skip to content

Commit ab719cc

Browse files
committed
Merge tag 'io_uring-6.15-20250522' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: - Kill a duplicate function definition, which can cause linking issues in certain .config configurations. Introduced in this cycle. - Fix for a potential overflow CQE reordering issue if a re-schedule is done during posting. Heading to stable. - Fix for an issue with recv bundles, where certain conditions can lead to gaps in the buffers, where a contiguous buffer range was expected. Heading to stable. * tag 'io_uring-6.15-20250522' of git://git.kernel.dk/linux: io_uring/net: only retry recv bundle for a full transfer io_uring: fix overflow resched cqe reordering io_uring/cmd: axe duplicate io_uring_cmd_import_fixed_vec() declaration
2 parents e85dea5 + 3a08988 commit ab719cc

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,7 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)
636636
* to care for a non-real case.
637637
*/
638638
if (need_resched()) {
639+
ctx->cqe_sentinel = ctx->cqe_cached;
639640
io_cq_unlock_post(ctx);
640641
mutex_unlock(&ctx->uring_lock);
641642
cond_resched();

io_uring/net.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,18 +827,24 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
827827
cflags |= IORING_CQE_F_SOCK_NONEMPTY;
828828

829829
if (sr->flags & IORING_RECVSEND_BUNDLE) {
830-
cflags |= io_put_kbufs(req, *ret, io_bundle_nbufs(kmsg, *ret),
830+
size_t this_ret = *ret - sr->done_io;
831+
832+
cflags |= io_put_kbufs(req, *ret, io_bundle_nbufs(kmsg, this_ret),
831833
issue_flags);
832834
if (sr->retry)
833835
cflags = req->cqe.flags | (cflags & CQE_F_MASK);
834836
/* bundle with no more immediate buffers, we're done */
835837
if (req->flags & REQ_F_BL_EMPTY)
836838
goto finish;
837-
/* if more is available, retry and append to this one */
838-
if (!sr->retry && kmsg->msg.msg_inq > 0 && *ret > 0) {
839+
/*
840+
* If more is available AND it was a full transfer, retry and
841+
* append to this one
842+
*/
843+
if (!sr->retry && kmsg->msg.msg_inq > 0 && this_ret > 0 &&
844+
!iov_iter_count(&kmsg->msg.msg_iter)) {
839845
req->cqe.flags = cflags & ~CQE_F_MASK;
840846
sr->len = kmsg->msg.msg_inq;
841-
sr->done_io += *ret;
847+
sr->done_io += this_ret;
842848
sr->retry = true;
843849
return false;
844850
}

io_uring/uring_cmd.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@ bool io_uring_try_cancel_uring_cmd(struct io_ring_ctx *ctx,
1717
struct io_uring_task *tctx, bool cancel_all);
1818

1919
void io_cmd_cache_free(const void *entry);
20-
21-
int io_uring_cmd_import_fixed_vec(struct io_uring_cmd *ioucmd,
22-
const struct iovec __user *uvec,
23-
size_t uvec_segs,
24-
int ddir, struct iov_iter *iter,
25-
unsigned issue_flags);

0 commit comments

Comments
 (0)