summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/btree.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2025-12-18 18:40:50 -0800
committerSasha Levin <sashal@kernel.org>2026-03-04 07:20:18 -0500
commitb41b89926aa8a49f0876c305583406221965f505 (patch)
treeb9e6247a92fd8a4214cb0fe4d696c1cc35da99f8 /fs/xfs/scrub/btree.c
parent861b00da56a0c41eb35a1e276fb5fb1fb0aa306c (diff)
xfs: mark data structures corrupt on EIO and ENODATA
[ Upstream commit f39854a3fb2f06dc69b81ada002b641ba5b4696b ] I learned a few things this year: first, blk_status_to_errno can return ENODATA for critical media errors; and second, the scrub code doesn't mark data structures as corrupt on ENODATA or EIO. Currently, scrub failing to capture these errors isn't all that impactful -- the checking code will exit to userspace with EIO/ENODATA, and xfs_scrub will log a complaint and exit with nonzero status. Most people treat fsck tools failing as a sign that the fs is corrupt, but online fsck should mark the metadata bad and keep moving. Cc: stable@vger.kernel.org # v4.15 Fixes: 4700d22980d459 ("xfs: create helpers to record and deal with scrub problems") Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Carlos Maiolino <cem@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/btree.c')
-rw-r--r--fs/xfs/scrub/btree.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index debf392e0515..67833b666c6f 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -40,6 +40,8 @@ __xchk_btree_process_error(
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
+ case -EIO:
+ case -ENODATA:
/* Note the badness but don't abort. */
sc->sm->sm_flags |= errflag;
*error = 0;