Page MenuHomeFreeBSD

aio: Fix up the opcode in aiocb32_copyin()

Authored by markj on Sep 11 2021, 4:24 PM.
Referenced Files
Unknown Object (File)
Fri, Nov 24, 6:19 AM
Unknown Object (File)
Oct 5 2023, 2:14 AM
Unknown Object (File)
Oct 5 2023, 1:58 AM
Unknown Object (File)
Oct 4 2023, 9:18 AM
Unknown Object (File)
Sep 23 2023, 6:35 PM
Unknown Object (File)
Sep 17 2023, 8:50 PM
Unknown Object (File)
Sep 7 2023, 4:23 AM
Unknown Object (File)
Aug 17 2023, 2:05 PM



With lio_listio(2), the opcode is specified by userspace rather than
being hard-coded by the system call (e.g., aio_readv() -> LIO_READV).
kern_lio_listio() calls aio_aqueue() with an opcode of LIO_NOP, which
gets fixed up when the aiocb is copied in.

When copying in a job request, we need to dynamically allocate a uio to
wrap the iovec. So aiocb_copyin() needs to get the opcode from the
aiocb and then decide whether an allocation is required. We failed to
do this in the COMPAT_FREEBSD32 case. Fix it.

Reported by:
Fixes: f30a1ae8d529 ("lio_listio(2): Allow LIO_READV and LIO_WRITEV.")

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable