mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
io_uring: ensure that io_init_req() passes in the right issue_flags
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: 08681391b8
("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>
This commit is contained in:
parent
a25aa776b0
commit
da24142b1e
1 changed files with 2 additions and 1 deletions
|
@ -7139,7 +7139,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue