[LTP] [PATCH v1] io_uring02.c: Check EOPNOTSUPP errno

Petr Vorel pvorel@suse.cz
Fri Jan 20 08:46:56 CET 2023


Hi Wei,

> Add check for errno == EOPNOTSUPP and quit with TCONF instead of TBROK

> Signed-off-by: Wei Gao <wegao@suse.com>
> ---
>  lib/tst_safe_io_uring.c | 4 ++++
>  1 file changed, 4 insertions(+)

> diff --git a/lib/tst_safe_io_uring.c b/lib/tst_safe_io_uring.c
> index f300fd38c..923c3e43d 100644
> --- a/lib/tst_safe_io_uring.c
> +++ b/lib/tst_safe_io_uring.c
> @@ -15,6 +15,10 @@ int safe_io_uring_init(const char *file, const int lineno,
>  	uring->fd = io_uring_setup(entries, params);

>  	if (uring->fd == -1) {
> +		if (errno == EOPNOTSUPP) {
> +			tst_brk(TCONF,
> +				"io_uring_setup() is not supported");
> +		}

I merged with these changes:

		if (errno == EOPNOTSUPP)
			tst_brk(TCONF, "CONFIG_IO_URING is not enabled");

* changed subject to: "tst_safe_io_uring.c: Check EOPNOTSUPP errno"
* Adjusted commit message (no io_uring_*() syscall will be working due
  CONFIG_IO_URING not enabled in the kernel).
* simplify if style

Thanks!

Kind regards,
Petr


More information about the ltp mailing list