[PATCH 2/3] io_u: Fix inconsistent handling of non-fatal errors with option error_dump
Niklas Cassel <[email protected]> Fri, 6 Feb 2026 17:40:57 +0100
| Newsgroups | org.kernel.vger.fio |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
---
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