From: Dave Chinner Date: Thu, 6 Mar 2014 23:27:30 +0000 (+1100) Subject: xfs_db: Use EFSBADCRC for CRC validity indication X-Git-Tag: v3.2.0-rc1~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c0a86ed6ef6c73d41d83a473a9dd6ddb1b1a6ec;p=thirdparty%2Fxfsprogs-dev.git xfs_db: Use EFSBADCRC for CRC validity indication 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 Reviewed-by: Eric Sandeen Signed-off-by: Dave Chinner --- diff --git a/db/io.c b/db/io.c index d29816c43..9a787c8f8 100644 --- 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 d8cf3831e..ad39beee2 100644 --- 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)); }