From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, Pavel Begunkov <[email protected]>
Subject: [PATCH 2/2] io_uring: fix async_data checks for msg setup
Date: Sun, 17 Oct 2021 20:33:22 +0000 [thread overview]
Message-ID: <6c5577b5189d22112e5d5716e5f1118b25418a19.1634501363.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
We should use req_has_async_data() instead of directly testing
->async_data to see if async_data has been allocated, there is one spot
slipped that doesn't follow the rule.
Fixes: 016e0451e9ed0 ("io_uring: control ->async_data with a REQ_F flag")
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 40b1697e7354..7ead1507be9b 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4683,9 +4683,9 @@ static int io_sync_file_range(struct io_kiocb *req, unsigned int issue_flags)
static int io_setup_async_msg(struct io_kiocb *req,
struct io_async_msghdr *kmsg)
{
- struct io_async_msghdr *async_msg = req->async_data;
+ struct io_async_msghdr *async_msg;
- if (async_msg)
+ if (req_has_async_data(req))
return -EAGAIN;
if (io_alloc_async_data(req)) {
kfree(kmsg->free_iov);
--
2.33.1
prev parent reply other threads:[~2021-10-17 20:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-17 20:33 [PATCH 0/2] two small fixes Pavel Begunkov
2021-10-17 20:33 ` [PATCH 1/2] io_uring: fail iopoll links if can't retry Pavel Begunkov
2021-10-17 20:33 ` Pavel Begunkov [this message]
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=6c5577b5189d22112e5d5716e5f1118b25418a19.1634501363.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
/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