]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: Use EFSBADCRC for CRC validity indication
authorDave Chinner <dchinner@redhat.com>
Thu, 6 Mar 2014 23:27:30 +0000 (10:27 +1100)
committerDave Chinner <david@fromorbit.com>
Thu, 6 Mar 2014 23:27:30 +0000 (10:27 +1100)
xfs_db currently gives indication as to whether a buffer CRC is ok
or not. Currently it does this by checking for EFSCORRUPTED in the
b_error field of the buffer. Now that we have EFSBADCRC to indicate
a bad CRC independently of structure corruption, use that instead to
drive the CRC correct/incorrect indication in the structured output.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
db/io.c
db/io.h

diff --git a/db/io.c b/db/io.c
index d29816c43046c6b1cd78cd27bb67f916077f1578..9a787c8f8ff736c9c8c1cb57a32f3626afb3d1f9 100644 (file)
--- a/db/io.c
+++ b/db/io.c
@@ -521,10 +521,11 @@ set_cur(
        }
 
        /*
-        * keep the buffer even if the verifier says it is corrupted.
+        * Keep the buffer even if the verifier says it is corrupted.
         * We're a diagnostic tool, after all.
         */
-       if (!bp || (bp->b_error && bp->b_error != EFSCORRUPTED))
+       if (!bp || (bp->b_error && bp->b_error != EFSCORRUPTED &&
+                                  bp->b_error != EFSBADCRC))
                return;
        iocur_top->buf = bp->b_addr;
        iocur_top->bp = bp;
diff --git a/db/io.h b/db/io.h
index d8cf3831e1cd57e5ad7921f794a4ae8b8e9aa2a6..ad39beee2c3295554876877de469e848334eac8e 100644 (file)
--- a/db/io.h
+++ b/db/io.h
@@ -67,6 +67,6 @@ static inline bool
 iocur_crc_valid()
 {
        return (iocur_top->bp &&
-               iocur_top->bp->b_error != EFSCORRUPTED &&
+               iocur_top->bp->b_error != EFSBADCRC &&
                (!iocur_top->ino_buf || iocur_top->ino_crc_ok));
 }