diff options
| author | Jens Axboe <axboe@kernel.dk> | 2026-03-17 14:21:58 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-03-17 14:35:00 -0600 |
| commit | 3e97c2582f8450117dfa14cc672437afb31233a0 (patch) | |
| tree | 58b63048ccfdea2018660bd528510a39d3438d01 /io_uring | |
| parent | 0a6b9ae1f314c92141b851fcbc2f7b4d0cd2e340 (diff) | |
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>
Diffstat (limited to 'io_uring')
| -rw-r--r-- | io_uring/rw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/rw.c b/io_uring/rw.c index 3bdb9914e673..046f76a71b9c 100644 --- a/io_uring/rw.c +++ b/io_uring/rw.c @@ -900,7 +900,7 @@ static int io_rw_init_file(struct io_kiocb *req, fmode_t mode, int rw_type) * We have a union of meta fields with wpq used for buffered-io * in io_async_rw, so fail it here. */ - if (!(req->file->f_flags & O_DIRECT)) + if (!(file->f_flags & O_DIRECT)) return -EOPNOTSUPP; kiocb->ki_flags |= IOCB_HAS_METADATA; kiocb->private = &io->meta; |
