Skip to content

Commit b366bd7

Browse files
committed
Merge tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block
Pull io_uring fix from Jens Axboe: "Just a single file assignment fix this week" * tag 'io_uring-5.18-2022-05-06' of git://git.kernel.dk/linux-block: io_uring: assign non-fixed early for async work
2 parents 4b97bac + a196c78 commit b366bd7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

fs/io_uring.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6947,7 +6947,12 @@ static int io_req_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
69476947

69486948
static int io_req_prep_async(struct io_kiocb *req)
69496949
{
6950-
if (!io_op_defs[req->opcode].needs_async_setup)
6950+
const struct io_op_def *def = &io_op_defs[req->opcode];
6951+
6952+
/* assign early for deferred execution for non-fixed file */
6953+
if (def->needs_file && !(req->flags & REQ_F_FIXED_FILE))
6954+
req->file = io_file_get_normal(req, req->fd);
6955+
if (!def->needs_async_setup)
69516956
return 0;
69526957
if (WARN_ON_ONCE(req_has_async_data(req)))
69536958
return -EFAULT;

0 commit comments

Comments
 (0)