xfs: mark data structures corrupt on EIO and ENODATA
PATCH 1/1 xfs: mark data structures corrupt on EIO and ENODATA
From: Darrick J. Wong <[email protected]>
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.
--- fs/xfs/scrub/btree.c | 2 ++ fs/xfs/scrub/common.c | 4 ++++ fs/xfs/scrub/dabtree.c | 2 ++ 3 files changed, 8 insertions(+)
fs/xfs/scrub/btree.c +2 -0
@@ -42,6 +42,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 ;
fs/xfs/scrub/common.c +4 -0
@@ -103,6 +103,8 @@ __xchk_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 ;
@@ -177,6 +179,8 @@ __xchk_fblock_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 ;
fs/xfs/scrub/dabtree.c +2 -0
@@ -45,6 +45,8 @@ xchk_da_process_error(break ;case -EFSBADCRC :case -EFSCORRUPTED : +case -EIO : +case -ENODATA :/* Note the badness but don't abort. */ sc->sm->sm_flags |=XFS_SCRUB_OFLAG_CORRUPT ; *error =0 ;
Quoted 11 lines · Darrick J. Wong
From: Darrick J. Wong <[email protected]>
I learned a few things this year: first,
blk_status_to_errnocan 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_scrubwill 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.
Looks good:
although we really need to stop blindly propagating the block layer errors. I'll add that to my ever growing todo list.
Quoted 11 lines · Darrick J. Wong
I learned a few things this year: first,
blk_status_to_errnocan 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_scrubwill 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.[...]
Applied to for-next, thanks!
[1/1] xfs: mark data structures corrupt on EIO and ENODATA
commit: f39854a3fb2f06dc69b81ada002b641ba5b4696b
Best regards,
Signature · 1 line
Carlos Maiolino <[email protected]>