Skip to content
Commit 7b9762a5 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring: zero iocb->ki_pos for stream file types

io_uring supports using offset == -1 for using the current file position,
and we read that in as part of read/write command setup. For the non-iter
read/write types we pass in NULL for the position pointer, but for the
iter types we should not be passing any anything but 0 for the position
for a stream.

Clear kiocb->ki_pos if the file is a stream, don't leave it as -1. If we
do, then the request will error with -ESPIPE.

Fixes: ba04291e ("io_uring: allow use of offset == -1 to mean file position")
Link: https://github.com/axboe/liburing/discussions/501


Reported-by: default avatarSamuel Williams <samuel.williams@oriontransfer.co.nz>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d800c65c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment