Skip to content

Commit 38eddee

Browse files
committed
Merge tag 'io_uring-6.0-2022-09-18' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: "Nothing really major here, but figured it'd be nicer to just get these flushed out for -rc6 so that the 6.1 branch will have them as well. That'll make our lives easier going forward in terms of development, and avoid trivial conflicts in this area. - Simple trace rename so that the returned opcode name is consistent with the enum definition (Stefan) - Send zc rsrc request vs notification lifetime fix (Pavel)" * tag 'io_uring-6.0-2022-09-18' of git://git.kernel.dk/linux: io_uring/opdef: rename SENDZC_NOTIF to SEND_ZC io_uring/net: fix zc fixed buf lifetime
2 parents a335366 + 9bd3f72 commit 38eddee

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

io_uring/net.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -905,22 +905,22 @@ int io_sendzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
905905
if (zc->flags & ~(IORING_RECVSEND_POLL_FIRST |
906906
IORING_RECVSEND_FIXED_BUF))
907907
return -EINVAL;
908+
notif = zc->notif = io_alloc_notif(ctx);
909+
if (!notif)
910+
return -ENOMEM;
911+
notif->cqe.user_data = req->cqe.user_data;
912+
notif->cqe.res = 0;
913+
notif->cqe.flags = IORING_CQE_F_NOTIF;
914+
req->flags |= REQ_F_NEED_CLEANUP;
908915
if (zc->flags & IORING_RECVSEND_FIXED_BUF) {
909916
unsigned idx = READ_ONCE(sqe->buf_index);
910917

911918
if (unlikely(idx >= ctx->nr_user_bufs))
912919
return -EFAULT;
913920
idx = array_index_nospec(idx, ctx->nr_user_bufs);
914921
req->imu = READ_ONCE(ctx->user_bufs[idx]);
915-
io_req_set_rsrc_node(req, ctx, 0);
922+
io_req_set_rsrc_node(notif, ctx, 0);
916923
}
917-
notif = zc->notif = io_alloc_notif(ctx);
918-
if (!notif)
919-
return -ENOMEM;
920-
notif->cqe.user_data = req->cqe.user_data;
921-
notif->cqe.res = 0;
922-
notif->cqe.flags = IORING_CQE_F_NOTIF;
923-
req->flags |= REQ_F_NEED_CLEANUP;
924924

925925
zc->buf = u64_to_user_ptr(READ_ONCE(sqe->addr));
926926
zc->len = READ_ONCE(sqe->len);

io_uring/opdef.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ const struct io_op_def io_op_defs[] = {
471471
.prep_async = io_uring_cmd_prep_async,
472472
},
473473
[IORING_OP_SEND_ZC] = {
474-
.name = "SENDZC_NOTIF",
474+
.name = "SEND_ZC",
475475
.needs_file = 1,
476476
.unbound_nonreg_file = 1,
477477
.pollout = 1,

0 commit comments

Comments
 (0)