Skip to content

Commit 1672aaf

Browse files
committed
Merge branch 'io_uring-6.16' into for-next
* io_uring-6.16: MAINTAINERS: remove myself from io_uring io_uring/net: only consider msg_inq if larger than 1 io_uring/zcrx: fix area release on registration failure io_uring/zcrx: init id for xa_find
2 parents cd2e103 + e931d3a commit 1672aaf

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12604,7 +12604,6 @@ F: include/linux/iosys-map.h
1260412604

1260512605
IO_URING
1260612606
M: Jens Axboe <[email protected]>
12607-
M: Pavel Begunkov <[email protected]>
1260812607
1260912608
S: Maintained
1261012609
T: git git://git.kernel.dk/linux-block

io_uring/net.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static inline bool io_recv_finish(struct io_kiocb *req, int *ret,
832832
* If more is available AND it was a full transfer, retry and
833833
* append to this one
834834
*/
835-
if (!sr->retry && kmsg->msg.msg_inq > 0 && this_ret > 0 &&
835+
if (!sr->retry && kmsg->msg.msg_inq > 1 && this_ret > 0 &&
836836
!iov_iter_count(&kmsg->msg.msg_iter)) {
837837
req->cqe.flags = cflags & ~CQE_F_MASK;
838838
sr->len = kmsg->msg.msg_inq;
@@ -1070,7 +1070,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg
10701070
arg.mode |= KBUF_MODE_FREE;
10711071
}
10721072

1073-
if (kmsg->msg.msg_inq > 0)
1073+
if (kmsg->msg.msg_inq > 1)
10741074
arg.max_len = min_not_zero(sr->len, kmsg->msg.msg_inq);
10751075

10761076
ret = io_buffers_peek(req, &arg);

io_uring/zcrx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ static void io_free_rbuf_ring(struct io_zcrx_ifq *ifq)
366366

367367
static void io_zcrx_free_area(struct io_zcrx_area *area)
368368
{
369-
io_zcrx_unmap_area(area->ifq, area);
369+
if (area->ifq)
370+
io_zcrx_unmap_area(area->ifq, area);
370371
io_release_area_mem(&area->mem);
371372

372373
kvfree(area->freelist);
@@ -631,12 +632,13 @@ int io_register_zcrx_ifq(struct io_ring_ctx *ctx,
631632
void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx)
632633
{
633634
struct io_zcrx_ifq *ifq;
634-
unsigned long id;
635635

636636
lockdep_assert_held(&ctx->uring_lock);
637637

638638
while (1) {
639639
scoped_guard(mutex, &ctx->mmap_lock) {
640+
unsigned long id = 0;
641+
640642
ifq = xa_find(&ctx->zcrx_ctxs, &id, ULONG_MAX, XA_PRESENT);
641643
if (ifq)
642644
xa_erase(&ctx->zcrx_ctxs, id);

0 commit comments

Comments
 (0)