Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 -1
+1 -1
io_uring/rw.c
··· 900 900 * We have a union of meta fields with wpq used for buffered-io 901 901 * in io_async_rw, so fail it here. 902 902 */ 903 - if (!(req->file->f_flags & O_DIRECT)) 903 + if (!(file->f_flags & O_DIRECT)) 904 904 return -EOPNOTSUPP; 905 905 kiocb->ki_flags |= IOCB_HAS_METADATA; 906 906 kiocb->private = &io->meta;