public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Zorro Lang <zlang@kernel.org>
Cc: fstests@vger.kernel.org,  io-uring@vger.kernel.org
Subject: Re: [PATCH 1/3] fsstress: check io_uring_queue_init errno properly
Date: Wed, 06 Mar 2024 10:56:08 -0500	[thread overview]
Message-ID: <x49edcnuzfr.fsf@segfault.usersys.redhat.com> (raw)
In-Reply-To: <20240306091935.4090399-2-zlang@kernel.org> (Zorro Lang's message of "Wed, 6 Mar 2024 17:19:33 +0800")

Zorro Lang <zlang@kernel.org> writes:

> As the manual of io_uring_queue_init says "io_uring_queue_init(3)
> returns 0 on success and -errno on failure". We should check if the
> return value is -ENOSYS, not the errno.
>
> Fixes: d15b1721f284 ("ltp/fsstress: don't fail on io_uring ENOSYS")
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>  ltp/fsstress.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 63c75767..482395c4 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -763,8 +763,8 @@ int main(int argc, char **argv)
>  #ifdef URING
>  			have_io_uring = true;
>  			/* If ENOSYS, just ignore uring, other errors are fatal. */
> -			if (io_uring_queue_init(URING_ENTRIES, &ring, 0)) {
> -				if (errno == ENOSYS) {
> +			if ((c = io_uring_queue_init(URING_ENTRIES, &ring, 0)) != 0) {
> +				if (c == -ENOSYS) {
>  					have_io_uring = false;
>  				} else {
>  					fprintf(stderr, "io_uring_queue_init failed\n");

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>


  parent reply	other threads:[~2024-03-06 15:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06  9:19 [PATCH 0/3] fstests: fix io_uring testing Zorro Lang
2024-03-06  9:19 ` [PATCH 1/3] fsstress: check io_uring_queue_init errno properly Zorro Lang
2024-03-06 15:53   ` Darrick J. Wong
2024-03-06 19:34     ` Zorro Lang
2024-03-06 15:56   ` Jeff Moyer [this message]
2024-03-06  9:19 ` [PATCH 2/3] fsstress: bypass io_uring testing if io_uring_queue_init returns EPERM Zorro Lang
2024-03-06 15:55   ` Darrick J. Wong
2024-03-06 19:36     ` Zorro Lang
2024-03-06 15:57   ` Jeff Moyer
2024-03-06 19:38     ` Zorro Lang
2024-03-06  9:19 ` [PATCH 3/3] common/rc: force enable io_uring in _require_io_uring Zorro Lang
2024-03-06 15:43   ` Darrick J. Wong
2024-03-06 15:59     ` Jeff Moyer
2024-03-06 19:56       ` Zorro Lang
2024-03-06 19:51     ` Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x49edcnuzfr.fsf@segfault.usersys.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=io-uring@vger.kernel.org \
    --cc=zlang@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox