]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: don't abort on bad directory leaf crc during leaf check
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 7 Apr 2015 00:04:11 +0000 (10:04 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 7 Apr 2015 00:04:11 +0000 (10:04 +1000)
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 <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/phase6.c

index 17286095ed19dbd3824d21ad0b562e36516e9fd1..c09b394b9fd6eaf78a56b62d1a0eafaaabbba4d1 100644 (file)
@@ -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);