[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220630132006.2825668-1-dylany@fb.com>
Date: Thu, 30 Jun 2022 06:20:06 -0700
From: Dylan Yudaken <dylany@...com>
To: Jens Axboe <axboe@...nel.dk>,
Pavel Begunkov <asml.silence@...il.com>,
<io-uring@...r.kernel.org>
CC: <Kernel-team@...com>, <linux-kernel@...r.kernel.org>,
Dylan Yudaken <dylany@...com>
Subject: [PATCH 5.19] io_uring: fix provided buffer import
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 <dylany@...com>
---
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
Powered by blists - more mailing lists