From ba1c677644747b41cdc91691e282efe1090449da Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 7 Apr 2015 10:04:11 +1000 Subject: [PATCH] xfs_repair: don't abort on bad directory leaf crc during leaf check longform_dir2_check_leaf() checks a directory leaf block to help decide if we need to rebuild the directory. If the verifier fails with a CRC or corrupt structure error, rebuild the directory instead of aborting. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- repair/phase6.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/repair/phase6.c b/repair/phase6.c index 17286095e..c09b394b9 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1951,7 +1951,12 @@ longform_dir2_check_leaf( da_bno = mp->m_dirleafblk; error = dir_read_buf(ip, da_bno, -1, &bp, &xfs_dir3_leaf1_buf_ops, &fixit); - if (error) { + if (error == EFSBADCRC || error == EFSCORRUPTED || fixit) { + do_warn( + _("leaf block %u for directory inode %" PRIu64 " bad CRC\n"), + da_bno, ip->i_ino); + return 1; + } else if (error) { do_error( _("can't read block %u for directory inode %" PRIu64 ", error %d\n"), da_bno, ip->i_ino, error); -- 2.47.2