Re: [PATCH 12/13] xfs_db: Use EFSBADCRC for CRC validity indication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/4/14, 2:51 AM, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> 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. Not that we have EFSBADCRC to indicate

Now that...

> 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@xxxxxxxxxx>

Reviewed-by: Eric Sandeen <sandeen@xxxxxxxxxx>

> ---
>  db/io.c | 5 +++--
>  db/io.h | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/db/io.c b/db/io.c
> index d29816c..9a787c8 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 d8cf383..ad39bee 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));
>  }
> 

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux