public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com
Subject: [PATCH 2/3] io_uring/msg: initialise msg request opcode
Date: Fri, 28 Mar 2025 23:11:50 +0000	[thread overview]
Message-ID: <9afe650fcb348414a4529d89f52eb8969ba06efd.1743190078.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1743190078.git.asml.silence@gmail.com>

It's risky to have msg request opcode set to garbage, so at least
initialise it to nop. Later we might want to add a user inaccessible
opcode for such cases.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/msg_ring.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/io_uring/msg_ring.c b/io_uring/msg_ring.c
index bea5a96587b7..6c51b942d020 100644
--- a/io_uring/msg_ring.c
+++ b/io_uring/msg_ring.c
@@ -93,6 +93,7 @@ static int io_msg_remote_post(struct io_ring_ctx *ctx, struct io_kiocb *req,
 		kmem_cache_free(req_cachep, req);
 		return -EOWNERDEAD;
 	}
+	req->opcode = IORING_OP_NOP;
 	req->cqe.user_data = user_data;
 	io_req_set_res(req, res, cflags);
 	percpu_ref_get(&ctx->refs);
-- 
2.48.1


  parent reply	other threads:[~2025-03-28 23:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 23:11 [PATCH 0/3] msg-ring clean ups Pavel Begunkov
2025-03-28 23:11 ` [PATCH 1/3] io_uring/msg: rename io_double_lock_ctx() Pavel Begunkov
2025-03-28 23:11 ` Pavel Begunkov [this message]
2025-03-28 23:11 ` [PATCH 3/3] io_uring: don't pass ctx to tw add remote helper Pavel Begunkov
2025-03-29 11:57 ` [PATCH 0/3] msg-ring clean ups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9afe650fcb348414a4529d89f52eb8969ba06efd.1743190078.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox