From: Niklas Cassel <cassel@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, Vincent Fu <vincent.fu@samsung.com>
Cc: fio@vger.kernel.org, Damien Le Moal <dlemoal@kernel.org>,
Jorgen S Hansen <jorgen.hansen@wdc.com>,
Niklas Cassel <cassel@kernel.org>
Subject: [PATCH 2/3] io_u: Fix inconsistent handling of non-fatal errors with option error_dump
Date: Fri, 6 Feb 2026 17:40:57 +0100 [thread overview]
Message-ID: <20260206164058.3105327-3-cassel@kernel.org> (raw)
In-Reply-To: <20260206164058.3105327-1-cassel@kernel.org>
Commit 8b28bd413759 ("backend: Add configurable non fatal error list")
added an early return in io_u_log_error() for non-fatal errors.
This early return is performed if the error is a non-fatal error, and if
error_dump is not set.
Looking at the help text for the error_dump option:
"If set dump every error even if it is non fatal, true by default.
If disabled only fatal error will be dumped."
So this commit made sure that, if error dump is NOT set:
For a non-fatal error, io_u_log_error() will return early and will thus:
1) NOT print an error to the log
2) NOT call td_verror()
However, if error dump is set, io_u_log_error() will not do an early
return, instead it will log the non-fatal error and then call td_verror().
It is clear that the intention is for a non-fatal error to not set
td->error. (If error_dump is used it should _log_ the non-fatal error.)
Thus, fix the code such that if error_dump is set, for a non-fatal error,
we:
1) print an error to the log
2) NOT call td_verror()
This will make the behavior in io_u_log_error() consistent.
If error_dump is set, we will log the non-fatal error, but regardless of
error_dump being set or not, we do NOT call td_verror() (which would set
td->error) for a non-fatal error, since that was obviously the intention
of commit 8b28bd413759 ("backend: Add configurable non fatal error list").
Fixes: 8b28bd413759 ("backend: Add configurable non fatal error list")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
io_u.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/io_u.c b/io_u.c
index ac9a1c7d..653a700c 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1985,8 +1985,14 @@ err_put:
static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
{
enum error_type_bit eb = td_error_type(io_u->ddir, io_u->error);
+ bool non_fatal_error = td_non_fatal_error(td, eb, io_u->error);
- if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
+ /*
+ * Non-fatal errors (errors that should be ignored), are normally not
+ * dumped to the log, unless td->o.error_dump. Regardless, non-fatal
+ * errors should never call td_verror() to set td->error.
+ */
+ if (non_fatal_error && !td->o.error_dump)
return;
log_err("fio: io_u error%s%s: %s: %s offset=%llu, buflen=%llu\n",
@@ -2008,7 +2014,7 @@ static void __io_u_log_error(struct thread_data *td, struct io_u *io_u)
}
}
- if (!td->error)
+ if (!td->error && !non_fatal_error)
td_verror(td, io_u->error, "io_u error");
}
--
2.53.0
next prev parent reply other threads:[~2026-02-06 16:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 16:40 [PATCH 0/3] fio: Avoid errno and errno string mismatch Niklas Cassel
2026-02-06 16:40 ` [PATCH 1/3] fio: Fix error string not matching errno Niklas Cassel
2026-02-13 3:12 ` Damien Le Moal
2026-02-06 16:40 ` Niklas Cassel [this message]
2026-02-13 3:17 ` [PATCH 2/3] io_u: Fix inconsistent handling of non-fatal errors with option error_dump Damien Le Moal
2026-02-06 16:40 ` [PATCH 3/3] stat: Remove duplicate space in __show_run_stats() Niklas Cassel
2026-02-13 3:17 ` Damien Le Moal
2026-02-06 17:57 ` [PATCH 0/3] fio: Avoid errno and errno string mismatch fiotestbot
2026-02-14 2:39 ` Vincent Fu
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=20260206164058.3105327-3-cassel@kernel.org \
--to=cassel@kernel.org \
--cc=axboe@kernel.dk \
--cc=dlemoal@kernel.org \
--cc=fio@vger.kernel.org \
--cc=jorgen.hansen@wdc.com \
--cc=vincent.fu@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox