All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.8] io_uring: fix not initialised work->flags
@ 2020-07-12 13:16 Pavel Begunkov
  2020-07-12 15:41 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Begunkov @ 2020-07-12 13:16 UTC (permalink / raw)
  To: Jens Axboe, io-uring

59960b9deb535 ("io_uring: fix lazy work init") tried to fix missing
io_req_init_async(), but left out work.flags and hash. Do it earlier.

Fixes: 7cdaf587de7c ("io_uring: avoid whole io_wq_work copy for requests completed inline")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---

note: unfortenatuly, this creates a merge conflict.

 fs/io_uring.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index a9ce2e6f03dd..eba3e8645fd4 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1096,6 +1096,8 @@ static inline void io_prep_async_work(struct io_kiocb *req,
 {
 	const struct io_op_def *def = &io_op_defs[req->opcode];
 
+	io_req_init_async(req);
+
 	if (req->flags & REQ_F_ISREG) {
 		if (def->hash_reg_file)
 			io_wq_hash_work(&req->work, file_inode(req->file));
@@ -1104,7 +1106,6 @@ static inline void io_prep_async_work(struct io_kiocb *req,
 			req->work.flags |= IO_WQ_WORK_UNBOUND;
 	}
 
-	io_req_init_async(req);
 	io_req_work_grab_env(req, def);
 
 	*link = io_prep_linked_timeout(req);
-- 
2.24.0


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

* Re: [PATCH 5.8] io_uring: fix not initialised work->flags
  2020-07-12 13:16 [PATCH 5.8] io_uring: fix not initialised work->flags Pavel Begunkov
@ 2020-07-12 15:41 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-07-12 15:41 UTC (permalink / raw)
  To: Pavel Begunkov, io-uring

On 7/12/20 7:16 AM, Pavel Begunkov wrote:
> 59960b9deb535 ("io_uring: fix lazy work init") tried to fix missing
> io_req_init_async(), but left out work.flags and hash. Do it earlier.

Thanks Pavel, applied.

-- 
Jens Axboe


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

end of thread, other threads:[~2020-07-12 15:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-12 13:16 [PATCH 5.8] io_uring: fix not initialised work->flags Pavel Begunkov
2020-07-12 15:41 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.