public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 5.19] io_uring: fix provided buffer import
@ 2022-06-30 13:20 Dylan Yudaken
  2022-06-30 14:56 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Dylan Yudaken @ 2022-06-30 13:20 UTC (permalink / raw)
  To: Jens Axboe, Pavel Begunkov, io-uring
  Cc: Kernel-team, linux-kernel, Dylan Yudaken

io_import_iovec uses the s pointer, but this was changed immediately
after the iovec was re-imported and so it was imported into the wrong
place.

Change the ordering.

Fixes: 2be2eb02e2f5 ("io_uring: ensure reads re-import for selected buffers")
Signed-off-by: Dylan Yudaken <[email protected]>
---
 fs/io_uring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5ff2cdb425bc..73ae92a62c2c 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4314,6 +4314,9 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
 		if (unlikely(ret < 0))
 			return ret;
 	} else {
+		rw = req->async_data;
+		s = &rw->s;
+
 		/*
 		 * Safe and required to re-import if we're using provided
 		 * buffers, as we dropped the selected one before retry.
@@ -4324,8 +4327,6 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
 				return ret;
 		}
 
-		rw = req->async_data;
-		s = &rw->s;
 		/*
 		 * We come here from an earlier attempt, restore our state to
 		 * match in case it doesn't. It's cheap enough that we don't
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 5.19] io_uring: fix provided buffer import
  2022-06-30 13:20 [PATCH 5.19] io_uring: fix provided buffer import Dylan Yudaken
@ 2022-06-30 14:56 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2022-06-30 14:56 UTC (permalink / raw)
  To: dylany, asml.silence, io-uring; +Cc: linux-kernel, Kernel-team

On Thu, 30 Jun 2022 06:20:06 -0700, Dylan Yudaken wrote:
> io_import_iovec uses the s pointer, but this was changed immediately
> after the iovec was re-imported and so it was imported into the wrong
> place.
> 
> Change the ordering.
> 
> 
> [...]

Applied, thanks!

[1/1] io_uring: fix provided buffer import
      commit: ee10e6851a687c58f516dc924034cb62c7a01e14

Best regards,
-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-30 14:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-30 13:20 [PATCH 5.19] io_uring: fix provided buffer import Dylan Yudaken
2022-06-30 14:56 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox