public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/4] io_uring: simplify io_rw_prep_async()
Date: Sun,  6 Sep 2020 00:45:45 +0300	[thread overview]
Message-ID: <e465708d526db522f77c1c1082fafc9e0721ddec.1599341028.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Don't touch iter->iov and iov inbetween __io_import_iovec() and
io_req_map_rw(), the former function aleady sets it right. because it
creates one more case with NULL'ed iov to consider in io_req_map_rw().

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index f703182df2d4..e45572fbb152 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2980,16 +2980,14 @@ static inline int io_rw_prep_async(struct io_kiocb *req, int rw,
 				   bool force_nonblock)
 {
 	struct io_async_rw *iorw = &req->io->rw;
-	struct iovec *iov;
+	struct iovec *iov = iorw->fast_iov;
 	ssize_t ret;
 
-	iorw->iter.iov = iov = iorw->fast_iov;
 	ret = __io_import_iovec(rw, req, &iov, &iorw->iter, !force_nonblock);
 	if (unlikely(ret < 0))
 		return ret;
 
-	iorw->iter.iov = iov;
-	io_req_map_rw(req, iorw->iter.iov, iorw->fast_iov, &iorw->iter);
+	io_req_map_rw(req, iov, iorw->fast_iov, &iorw->iter);
 	return 0;
 }
 
-- 
2.24.0


  reply	other threads:[~2020-09-05 21:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05 21:45 [PATCH 0/4] iov remapping hardening Pavel Begunkov
2020-09-05 21:45 ` Pavel Begunkov [this message]
2020-09-05 21:45 ` [PATCH 2/4] io_uring: refactor io_req_map_rw() Pavel Begunkov
2020-09-05 21:45 ` [PATCH 3/4] io_uring: fix ovelapped memcpy in io_req_map_rw() Pavel Begunkov
2020-09-05 21:45 ` [PATCH 4/4] io_uring: kill extra user_bufs check Pavel Begunkov
2020-09-05 21:58 ` [PATCH 0/4] iov remapping hardening Jens Axboe
2020-09-05 22:15   ` Pavel Begunkov
2020-09-05 22:34     ` Jens Axboe
2020-09-05 22:51       ` 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=e465708d526db522f77c1c1082fafc9e0721ddec.1599341028.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