From: cem@kernel.org
To: linux-xfs@vger.kernel.org
Subject: [RFC PATCH 3/3] xfs: make xfs_iomap_write_direct() report an error to xfs_trans_cancel
Date: Fri, 4 Sep 2026 13:32:23 +0200 [thread overview]
Message-ID: <20260904113231.1408890-4-cem@kernel.org> (raw)
In-Reply-To: <20260904113231.1408890-1-cem@kernel.org>
From: Carlos Maiolino <cem@kernel.org>
I've been in the situation a few times where the transaction got
cancelled by some reason. Most of time because bmapi_write failed and I
start a guessing game trying to understand why.
So if xfs_iomap_write_direct fails and it causes the transaction to be
cancelled, send the error to xfs_trans_cancel so the error gets logged
into the kernel log buffer.
Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
---
fs/xfs/xfs_iomap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index ff05e6b1b0bb..3d1a52757697 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -344,7 +344,7 @@ xfs_iomap_write_direct(
return error;
out_trans_cancel:
- xfs_trans_cancel(tp);
+ xfs_trans_cancel(tp, error);
goto out_unlock;
}
--
2.55.0
next prev parent 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 [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 ` cem [this message]
2026-09-05 1:11 ` [RFC PATCH 3/3] xfs: make xfs_iomap_write_direct() report an error to xfs_trans_cancel 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-4-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.