xfs
[Top] [All Lists]

Re: [PATCH 6/7] xfs: add xfs_verifier_error()

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: Re: [PATCH 6/7] xfs: add xfs_verifier_error()
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 13 Feb 2014 21:56:35 -0600
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <52F9957A.4050301@xxxxxxxxxxx>
References: <52F99426.3010409@xxxxxxxxxxx> <52F9957A.4050301@xxxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
On 2/10/14, 9:14 PM, Eric Sandeen wrote:
> We want to distinguish between corruption and CRC errors.
> In addition, the full stack trace on verifier errors
> seems less than helpful; it looks more like an oops than
> corruption.
> 
> Create a new function to specifically alert the user to
> verifier errors, which can differentiate between
> EFSCORRUPTED and CRC mismatches.  It doesn't dump stack
> unless the xfs error level is turned up high.
> 
> Define a new error message (EFSBADCRC) to clearly identify
> CRC errors.  (Defined to EILSEQ, bad byte sequence)
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>

...

> +void
> +xfs_verifier_error(
> +     struct xfs_buf          *bp)
> +{
> +     struct xfs_mount *mp = bp->b_target->bt_mount;
> +
> +     xfs_alert(mp,
> +"Metadata %s detected at %pF, block 0x%llx. Unmount and run xfs_repair",
> +               bp->b_error == EFSBADCRC ? "CRC error" : "corruption",
> +               __builtin_return_address(0), bp->b_bn);
> +
> +     if (xfs_error_level >= XFS_ERRLEVEL_LOW)
> +             xfs_hex_dump(bp->b_addr, 64);

This needs to handle the case where we have a page array rather than a b_addr, 
as well.

(The existing calls to XFS_CORRUPTION_ERROR would have oopsed on this too)

-Eric

<Prev in Thread] Current Thread [Next in Thread>