summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2023-03-03 06:49:57 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2023-03-03 14:51:37 +0000
commiteca2af649aaa3d00a43cc27bb567e36a7c28368a (patch)
tree040a5ab2dbf4d38d241b7ece30d8d2cf598c6fe3
parent82d4428d99a8facd107d9aaa4d3f92d36b283fd0 (diff)
downloadcommon-android13-5.15-2022-08.tar.gz
UPSTREAM: io_uring: ensure that io_init_req() passes in the right issue_flagsdeprecated/android13-5.15-2022-08android13-5.15-2022-08
We can't use 0 here, as io_init_req() is always invoked with the ctx uring_lock held. Newer kernels have IO_URING_F_UNLOCKED for this, but previously we used IO_URING_F_NONBLOCK to indicate this as well. Fixes: cf7f9cd50013 ("io_uring: add missing lock in io_get_file_fixed") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 937c15e27a63a071d1622928dea6edc8447db738) Bug: 268174392 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: I762eacf1b49ca8a38d8b77c44db4ca2bc49b2c4c
-rw-r--r--io_uring/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 7857b3d9d6a7..51d6fbe17f7f 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -7310,7 +7310,8 @@ static int io_init_req(struct io_ring_ctx *ctx, struct io_kiocb *req,
if (io_op_defs[req->opcode].needs_file) {
req->file = io_file_get(ctx, req, READ_ONCE(sqe->fd),
- (sqe_flags & IOSQE_FIXED_FILE), 0);
+ (sqe_flags & IOSQE_FIXED_FILE),
+ IO_URING_F_NONBLOCK);
if (unlikely(!req->file))
ret = -EBADF;
}