[LTP] [PATCH v5] io_submit04: Add test case for RWF_NOWAIT flag
Andrea Cervesato
andrea.cervesato@suse.com
Tue Mar 17 10:54:30 CET 2026
Hi Wei,
Thanks for the patch. I have a few issues to address before this can
be merged.
> diff --git a/include/lapi/aio_abi.h b/include/lapi/aio_abi.h
> +struct iocb_fallback {
> + uint64_t aio_data;
> +#if __BYTE_ORDER == __LITTLE_ENDIAN
> + uint32_t aio_key;
> + uint32_t aio_rw_flags;
The struct body uses spaces for indentation instead of tabs. Please
convert to tabs to match the kernel coding style used in other lapi
headers.
> +static void cleanup(void)
> +{
> + if (fd[0])
> + SAFE_CLOSE(fd[0]);
> +
> + if (fd[1])
> + SAFE_CLOSE(fd[1]);
fd is initialised to {-1, -1}. The check `if (fd[0])` is truthy for
-1, so if setup() aborts before SAFE_PIPE() (e.g. io_setup fails),
cleanup will call SAFE_CLOSE(-1) which fails with EBADF and triggers
a spurious TBROK. Use the standard LTP pattern:
if (fd[0] != -1)
SAFE_CLOSE(fd[0]);
if (fd[1] != -1)
SAFE_CLOSE(fd[1]);
> + TEST(tst_syscall(__NR_io_submit, ctx, nr, iocbs));
> +
> + if (TST_RET == -1 && errno == EOPNOTSUPP) {
After the TEST() macro, use TST_ERR instead of bare errno:
if (TST_RET == -1 && TST_ERR == EOPNOTSUPP) {
Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato@suse.com
More information about the ltp
mailing list