[PATCH v3 0/4] iomap: fix error handling regressions
From: Andrea Parri
Date: Mon Sep 28 2026 - 04:49:17 EST
Fix three independent error handling regressions in iomap:
- clear the writeback context after a failed ->writeback_submit() call,
preventing an already completed ioend from being submitted again;
- preserve an iomap iteration error when iomap_fiemap() has a pending
extent to emit; and
- preserve a direct I/O data path error when sub-block tail zeroing
succeeds.
The three fixes have no ordering dependencies and can be applied or
backported independently. Each issue was reproduced before and after
its respective fix.
Patch 2 is not a fix and carries no stable tag: it adds an XFS error
tag (requested by Christoph) that lets patch 1's ->writeback_submit()
failure be injected without the boot-param hack used for the original
reproduction. The corresponding xfstest (list corruption caught via
CONFIG_LIST_HARDENED on an unfixed kernel, clean writeback failure on a
fixed one) was posted to fstests@xxxxxxxxxxxxxxx:
https://lore.kernel.org/all/20260924091338.198407-1-parri.andrea@xxxxxxxxx/
Changes since v2:
- Patch 1: no code change; picked up Christoph's Reviewed-by.
- Patch 2: fixed the alignment of the new XFS_ERRTAG_WB_COW_CONVERT_ERROR
define; picked up Reviewed-by tags from Darrick and Christoph.
- Patch 3: no change.
- Patch 4: dropped the reformatting of the iomap_dio_zero() prototype,
keeping the iomap two-tab indent style (Christoph); added the
"# v6.12" stable version tag (Darrick); picked up Reviewed-by tags
from Darrick and Pankaj.
Changes since v1:
- Patch 1: reworded the added comment to fit 80 columns (Christoph);
described the reproducer in the commit message (fault-injected
->writeback_submit() failure on a reflinked XFS file, reliably hits
list_add double add on the unfixed kernel); documented why the final
->writeback_submit() call in iomap_writepages() needs no equivalent
fix, since wpc is never reused after it; picked up the version-scoped
stable tag Darrick suggested; picked up Brian's Reviewed-by.
- Patch 2: new, added per Christoph's request.
- Patch 3 (was 2/3): no code change; picked up the version-scoped
stable tag Darrick suggested; picked up Reviewed-by tags from Brian,
Darrick, and Christoph.
- Patch 4 (was 3/3): reworked per Christoph's suggestion to make
iomap_dio_zero() return void and drop the handling of its return
value, since it can only fail via a can't-happen WARN_ON_ONCE()
assert; this also resolves Darrick's question about the local
variable's type. Brian's v1 Reviewed-by was dropped due to the
rework.
v2: https://lore.kernel.org/all/20260924091203.198225-1-parri.andrea@xxxxxxxxx/
v1: https://lore.kernel.org/all/20260921083133.2960-1-parri.andrea@xxxxxxxxx/
Andrea Parri (4):
iomap: don't resubmit an ioend after ->writeback_submit() failed
xfs: add an error tag to inject a ->writeback_submit() failure
iomap: don't lose a fiemap iteration error when emitting the last
extent
iomap: don't lose a failed direct I/O bio's error when zeroing the
tail
fs/iomap/direct-io.c | 16 +++++-----------
fs/iomap/fiemap.c | 8 ++++----
fs/iomap/ioend.c | 10 +++++++++-
fs/xfs/libxfs/xfs_errortag.h | 6 ++++--
fs/xfs/xfs_reflink.c | 5 +++++
5 files changed, 27 insertions(+), 18 deletions(-)
base-commit: 93f51579e7df248780214094418f205253383cc5
--
2.53.0