]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
repair: handle uncorrected corruptions in phase 2
authorDave Chinner <dchinner@redhat.com>
Fri, 11 Jul 2014 02:00:51 +0000 (12:00 +1000)
committerDave Chinner <david@fromorbit.com>
Fri, 11 Jul 2014 02:00:51 +0000 (12:00 +1000)
Some of the AG header corruptions detected by the IO verifiers
cannot be corrected in phase 2 when we do the initial scan of the
AGs. Correcting some errors cannot be done until a full rebuild of
the trees is done in phase 5.

Hence we can end up with a "clean" AGF/AGI buffer but have a
EFSCORRUPTED error on the buffer. This results in an assert failing:

ASSERT(agf_dirty || agfbuf->b_error != EFSCORRUPTED);

and repair not beign able to fix the problems it has tripped over.
Hence the assert that we corrected all corruptions in the buffers
is not valid and should be removed.

Reported-by: Hans Kraus <hans.w.kraus@gmx.at>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/scan.c

index f29ff8d6cc311bce8df36515a17481d1e21f9336..142d8d783f41058e94ea80d03b8dc315fa028b07 100644 (file)
@@ -1572,14 +1572,13 @@ scan_ag(
 
        /*
         * Only pay attention to CRC/verifier errors if we can correct them.
-        * While there, ensure that we corrected a corruption error if the
-        * verifier detected one.
+        * Note that we can get uncorrected EFSCORRUPTED errors here because
+        * the verifier will flag on out of range values that we can't correct
+        * until phase 5 when we have all the information necessary to rebuild
+        * the freespace/inode btrees. We can correct bad CRC errors
+        * immediately, though.
         */
        if (!no_modify) {
-               ASSERT(agi_dirty || agibuf->b_error != EFSCORRUPTED);
-               ASSERT(agf_dirty || agfbuf->b_error != EFSCORRUPTED);
-               ASSERT(sb_dirty || sbbuf->b_error != EFSCORRUPTED);
-
                agi_dirty += (agibuf->b_error == EFSBADCRC);
                agf_dirty += (agfbuf->b_error == EFSBADCRC);
                sb_dirty += (sbbuf->b_error == EFSBADCRC);