From: cem@kernel.org
To: linux-xfs@vger.kernel.org
Subject: [RFC PATCH 0/3] Log transaction cancel error codes in the kernel log buffer
Date: Fri, 4 Sep 2026 13:32:20 +0200 [thread overview]
Message-ID: <20260904113231.1408890-1-cem@kernel.org> (raw)
From: Carlos Maiolino <cem@kernel.org>
Hi, this is a big RFC which is just compiled tested and has the only
goal to get opinions, please don't use it...
Once in a while we face some sort of failure where a transaction gets
cancelled in the middle of an IO operation and it is not always easy to
understand why.
One of these reasons is when xfs_bmapi_write() fails. It can fail for
several reasons and sometimes we get to start a guessing game on why it
actually failed.
So I thought it would be useful to have xfs_trans_cancel() to log the
exact -ERRORCODE that caused the transaction to cancel.
The reason I used a variadic function was mostly to make it a smaller
patch instead of a long sed-generated patch which would not make my
point, although I kind'a liked it :P
Another approach I thought would be to add a t_error field to the
transaction descriptor and report it via the tracepoint, so callers
could opt to set an error code or not.
Does this seem useful to anybody else or should I just abort the idea?
Cheers.
Carlos Maiolino (3):
xfs: add xfs_error_report the ability to display an error code
xfs: enable xfs_trans_cancel() to report and error code
xfs: make xfs_iomap_write_direct() report an error to xfs_trans_cancel
fs/xfs/xfs_error.c | 7 ++++++-
fs/xfs/xfs_error.h | 10 +++++-----
fs/xfs/xfs_exchmaps_item.c | 6 +++---
fs/xfs/xfs_inode_item.c | 2 +-
fs/xfs/xfs_iomap.c | 2 +-
fs/xfs/xfs_log_recover.c | 2 +-
fs/xfs/xfs_trans.c | 12 +++++++++---
fs/xfs/xfs_trans.h | 8 +++++++-
8 files changed, 33 insertions(+), 16 deletions(-)
--
2.55.0
next reply other threads:[~2026-09-04 11:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-04 11:32 cem [this message]
2026-09-04 11:32 ` [RFC PATCH 1/3] xfs: add xfs_error_report the ability to display an error code cem
2026-09-05 1:08 ` Darrick J. Wong
2026-09-07 6:04 ` Christoph Hellwig
2026-09-07 6:39 ` Carlos Maiolino
2026-09-08 5:36 ` Carlos Maiolino
2026-09-08 14:54 ` Darrick J. Wong
2026-09-04 11:32 ` [RFC PATCH 2/3] xfs: enable xfs_trans_cancel() to report and " cem
2026-09-05 1:10 ` Darrick J. Wong
2026-09-07 6:05 ` Christoph Hellwig
2026-09-08 6:36 ` Carlos Maiolino
2026-09-04 11:32 ` [RFC PATCH 3/3] xfs: make xfs_iomap_write_direct() report an error to xfs_trans_cancel cem
2026-09-05 1:11 ` Darrick J. Wong
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=20260904113231.1408890-1-cem@kernel.org \
--to=cem@kernel.org \
--cc=linux-xfs@vger.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