diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2022-09-18 19:25:27 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-09-18 19:25:27 +0300 |
commit | 38eddeedbbeac33f26845c29e7414b9313ea70db (patch) | |
tree | 3643297470fe54049212ba3c69a0ae4214cf65d3 /io_uring | |
parent | a335366bad1364a07f49df9da1fdfa6d411a5f39 (diff) | |
parent | 9bd3f728223ebcfef8e9d087bdd142f0e388215d (diff) | |
download | linux-38eddeedbbeac33f26845c29e7414b9313ea70db.tar.xz |
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
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/net.c | 16 | ||||
-rw-r--r-- | io_uring/opdef.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/io_uring/net.c b/io_uring/net.c index e9efed40cf3d..60e392f7f2dc 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -905,6 +905,13 @@ int io_sendzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) if (zc->flags & ~(IORING_RECVSEND_POLL_FIRST | IORING_RECVSEND_FIXED_BUF)) return -EINVAL; + notif = zc->notif = io_alloc_notif(ctx); + if (!notif) + return -ENOMEM; + notif->cqe.user_data = req->cqe.user_data; + notif->cqe.res = 0; + notif->cqe.flags = IORING_CQE_F_NOTIF; + req->flags |= REQ_F_NEED_CLEANUP; if (zc->flags & IORING_RECVSEND_FIXED_BUF) { unsigned idx = READ_ONCE(sqe->buf_index); @@ -912,15 +919,8 @@ int io_sendzc_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) return -EFAULT; idx = array_index_nospec(idx, ctx->nr_user_bufs); req->imu = READ_ONCE(ctx->user_bufs[idx]); - io_req_set_rsrc_node(req, ctx, 0); + io_req_set_rsrc_node(notif, ctx, 0); } - notif = zc->notif = io_alloc_notif(ctx); - if (!notif) - return -ENOMEM; - notif->cqe.user_data = req->cqe.user_data; - notif->cqe.res = 0; - notif->cqe.flags = IORING_CQE_F_NOTIF; - req->flags |= REQ_F_NEED_CLEANUP; zc->buf = u64_to_user_ptr(READ_ONCE(sqe->addr)); zc->len = READ_ONCE(sqe->len); diff --git a/io_uring/opdef.c b/io_uring/opdef.c index c61494e0a602..c4dddd0fd709 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -471,7 +471,7 @@ const struct io_op_def io_op_defs[] = { .prep_async = io_uring_cmd_prep_async, }, [IORING_OP_SEND_ZC] = { - .name = "SENDZC_NOTIF", + .name = "SEND_ZC", .needs_file = 1, .unbound_nonreg_file = 1, .pollout = 1, |