Skip to content

Commit 3e97c25

Browse files
committed
io_uring/rw: use cached file rather than req->file
In io_rw_init_file(), req->file is cached in file, yet the former is still being used when checking for O_DIRECT. As this is post setting the kiocb flags, the compiler has to reload req->file. Just use the locally cached file instead. Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0a6b9ae commit 3e97c25

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

io_uring/rw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode, int rw_type)
900900
* We have a union of meta fields with wpq used for buffered-io
901901
* in io_async_rw, so fail it here.
902902
*/
903-
if (!(req->file->f_flags & O_DIRECT))
903+
if (!(file->f_flags & O_DIRECT))
904904
return -EOPNOTSUPP;
905905
kiocb->ki_flags |= IOCB_HAS_METADATA;
906906
kiocb->private = &io->meta;

0 commit comments

Comments
 (0)