From: Keith Busch <kbusch@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
Damien Le Moal <dlemoal@kernel.org>,
linux-block@vger.kernel.org
Subject: Re: [PATCH blktests] src/dio-offsets.c: Fix err() usage
Date: Thu, 26 Mar 2026 11:42:13 -0600 [thread overview]
Message-ID: <acVv9VC-eNsUMma7@kbusch-mbp> (raw)
In-Reply-To: <20260326173632.3259254-1-bvanassche@acm.org>
On Thu, Mar 26, 2026 at 10:36:32AM -0700, Bart Van Assche wrote:
> If the dio-offsets program detects data corruption, it reports the
> following message:
>
> dio-offsets: test_unaligned_vectors: data corruption: Success
>
> The "Success" part in this message is confusing and is reported because
> the err() macro is used incorrectly. errno must be set before err() is
> used instead of passing an error number as first argument. Fix usage of
> the err() macro as follows:
> - Change the first argument into EXIT_FAILURE (1). According to POSIX,
> exit codes 1 - 125 mean failure and > 128 means that a program was
> terminated by a signal. Hence, exit with code 1 instead of -1 if
> ioctl() fails.
> - Use the err_errno() macro to set the error code instead of passing an
> error code as first argument to err().
Looks good:
Reviewed-by: Keith Busch <kbusch@kernel.org>
next prev parent reply other threads:[~2026-03-26 17:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 17:36 [PATCH blktests] src/dio-offsets.c: Fix err() usage Bart Van Assche
2026-03-26 17:42 ` Keith Busch [this message]
2026-04-04 8:35 ` Shinichiro Kawasaki
2026-04-06 13:51 ` Bart Van Assche
2026-04-07 3:37 ` Shinichiro Kawasaki
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=acVv9VC-eNsUMma7@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=bvanassche@acm.org \
--cc=dlemoal@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=shinichiro.kawasaki@wdc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.