Linux XFS filesystem development
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Log transaction cancel error codes in the kernel log buffer
@ 2026-09-04 11:32 cem
  2026-09-04 11:32 ` [RFC PATCH 1/3] xfs: add xfs_error_report the ability to display an error code cem
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: cem @ 2026-09-04 11:32 UTC (permalink / raw)
  To: linux-xfs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-09-08 14:54 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 11:32 [RFC PATCH 0/3] Log transaction cancel error codes in the kernel log buffer cem
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox