|
Gabriel Krisman Bertazi |
647f99 |
From 3884b83dff245e41def99ceacca8ed2056baf0a8 Mon Sep 17 00:00:00 2001
|
|
Gabriel Krisman Bertazi |
647f99 |
From: Jens Axboe <axboe@kernel.dk>
|
|
Gabriel Krisman Bertazi |
647f99 |
Date: Mon, 25 Oct 2021 13:45:12 -0600
|
|
Gabriel Krisman Bertazi |
647f99 |
Subject: [PATCH] io_uring: don't assign write hint in the read path
|
|
Gabriel Krisman Bertazi |
647f99 |
Git-commit: 3884b83dff245e41def99ceacca8ed2056baf0a8
|
|
Gabriel Krisman Bertazi |
647f99 |
Patch-mainline: v5.16-rc1
|
|
Gabriel Krisman Bertazi |
647f99 |
References: bsc#1205205
|
|
Gabriel Krisman Bertazi |
647f99 |
|
|
Gabriel Krisman Bertazi |
647f99 |
Move this out of the generic read/write prep path, and place it in the
|
|
Gabriel Krisman Bertazi |
647f99 |
write specific kiocb setup instead.
|
|
Gabriel Krisman Bertazi |
647f99 |
|
|
Gabriel Krisman Bertazi |
647f99 |
Signed-off-by: Jens Axboe <axboe@kernel.dk>
|
|
Gabriel Krisman Bertazi |
647f99 |
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
|
|
Gabriel Krisman Bertazi |
647f99 |
---
|
|
Gabriel Krisman Bertazi |
647f99 |
fs/io_uring.c | 2 +-
|
|
Gabriel Krisman Bertazi |
647f99 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Gabriel Krisman Bertazi |
647f99 |
|
|
Gabriel Krisman Bertazi |
647f99 |
diff --git a/fs/io_uring.c b/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
647f99 |
index bba2f77ae7e7..d001cd7a6c51 100644
|
|
Gabriel Krisman Bertazi |
647f99 |
--- a/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
647f99 |
+++ b/fs/io_uring.c
|
|
Gabriel Krisman Bertazi |
647f99 |
@@ -2825,7 +2825,6 @@ static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
|
Gabriel Krisman Bertazi |
647f99 |
req->flags |= REQ_F_CUR_POS;
|
|
Gabriel Krisman Bertazi |
647f99 |
kiocb->ki_pos = file->f_pos;
|
|
Gabriel Krisman Bertazi |
647f99 |
}
|
|
Gabriel Krisman Bertazi |
647f99 |
- kiocb->ki_hint = ki_hint_validate(file_write_hint(file));
|
|
Gabriel Krisman Bertazi |
647f99 |
kiocb->ki_flags = iocb_flags(file);
|
|
Gabriel Krisman Bertazi |
647f99 |
ret = kiocb_set_rw_flags(kiocb, READ_ONCE(sqe->rw_flags));
|
|
Gabriel Krisman Bertazi |
647f99 |
if (unlikely(ret))
|
|
Gabriel Krisman Bertazi |
647f99 |
@@ -3568,6 +3567,7 @@ static int io_write_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
|
Gabriel Krisman Bertazi |
647f99 |
{
|
|
Gabriel Krisman Bertazi |
647f99 |
if (unlikely(!(req->file->f_mode & FMODE_WRITE)))
|
|
Gabriel Krisman Bertazi |
647f99 |
return -EBADF;
|
|
Gabriel Krisman Bertazi |
647f99 |
+ req->rw.kiocb.ki_hint = ki_hint_validate(file_write_hint(req->file));
|
|
Gabriel Krisman Bertazi |
647f99 |
return io_prep_rw(req, sqe);
|
|
Gabriel Krisman Bertazi |
647f99 |
}
|
|
Gabriel Krisman Bertazi |
647f99 |
|
|
Gabriel Krisman Bertazi |
647f99 |
--
|
|
Gabriel Krisman Bertazi |
647f99 |
2.35.3
|
|
Gabriel Krisman Bertazi |
647f99 |
|