Skip to content

RFC Log transaction cancel error codes in the kernel log buffer

[email protected] linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3xfs: add xfs_error_report the ability to display an error codefs/xfs/xfs_error.c fs/xfs/xfs_error.h fs/xfs/xfs_exchmaps_item.c +2 more+16 -115 replies
2/3xfs: enable xfs_trans_cancel() to report and error codefs/xfs/xfs_trans.c fs/xfs/xfs_trans.h+16 -43 replies
3/3xfs: make xfs_iomap_write_direct() report an error to xfs_trans_cancelfs/xfs/xfs_iomap.c+1 -11 reply

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchDarrick J. Wong
1/3
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [RFC PATCH 0/3] Log transaction cancel error codes in the kernel log buffer

From: Carlos Maiolino <[email protected]>

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(-)
Signature · 1 line
2.55.0