]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix XFS_ERRTAG_FORCE_ZERO_RANGE for zoned file system
authorChristoph Hellwig <hch@lst.de>
Mon, 15 Dec 2025 06:05:46 +0000 (07:05 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 16 Dec 2025 08:21:38 +0000 (09:21 +0100)
commit8dc15b7a6e5918bad2b0583cf63d170f94a212df
treec306bbb81c987bc237b4ade15f4ccd51abb9bc7c
parentfc40459de82543b565ebc839dca8f7987f16f62e
xfs: fix XFS_ERRTAG_FORCE_ZERO_RANGE for zoned file system

The new XFS_ERRTAG_FORCE_ZERO_RANGE error tag added by commit
ea9989668081 ("xfs: error tag to force zeroing on debug kernels") fails
to account for the zoned space reservation rules and this reliably fails
xfs/131 because the zeroing operation returns -EIO.

Fix this by reserving enough space to zero the entire range, which
requires a bit of (fairly ugly) reshuffling to do the error injection
early enough to affect the space reservation.

Fixes: ea9989668081 ("xfs: error tag to force zeroing on debug kernels")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_file.c