On 2/17/25 13:58, Jens Axboe wrote:
On 2/17/25 6:37 AM, Pavel Begunkov wrote: The kiocb semantics of ki_complete == NULL -> sync kiocb is also odd,
That's what is_sync_kiocb() does. Would be cleaner to use init_sync_kiocb(), but there is a larger chance to do sth wrong as it's reinitialises it entirely.
but probably fine for this case as read mshot strictly deals with pollable files. Otherwise you'd just be blocking off this issue, regardless of whether or not IOCB_NOWAIT is set. In any case, it'd be much nicer to container this in io_read_mshot() where it arguably belongs, rather than sprinkle it in __io_read(). Possible?
That's what I tried first, but __io_read() -> io_rw_init_file() reinitialises it, so I don't see any good way without some broader refactoring. -- Pavel Begunkov