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

Set rw->free_iovec to @iovec, that's gives identical result and stresses
that @iovec param rw->free_iovec play the same role.

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

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e45572fbb152..03808e865dde 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2925,7 +2925,7 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
 	struct io_async_rw *rw = &req->io->rw;
 
 	memcpy(&rw->iter, iter, sizeof(*iter));
-	rw->free_iovec = NULL;
+	rw->free_iovec = iovec;
 	rw->bytes_done = 0;
 	/* can only be fixed buffers, no need to do anything */
 	if (iter->type == ITER_BVEC)
@@ -2942,7 +2942,6 @@ static void io_req_map_rw(struct io_kiocb *req, const struct iovec *iovec,
 			memcpy(rw->fast_iov + iov_off, fast_iov + iov_off,
 			       sizeof(struct iovec) * iter->nr_segs);
 	} else {
-		rw->free_iovec = iovec;
 		req->flags |= REQ_F_NEED_CLEANUP;
 	}
 }
-- 
2.24.0


  parent 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 ` [PATCH 1/4] io_uring: simplify io_rw_prep_async() Pavel Begunkov
2020-09-05 21:45 ` Pavel Begunkov [this message]
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=aec70b7263344b198af81afdfbd7c48ccc9fae98.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