xfs
[Top] [All Lists]

Re: [PATCH 10/19] xfs: verify dquot blocks as they are read from disk

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 10/19] xfs: verify dquot blocks as they are read from disk
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 11 Oct 2012 17:48:05 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1349754670-32009-11-git-send-email-david@xxxxxxxxxxxxx>
References: <1349754670-32009-1-git-send-email-david@xxxxxxxxxxxxx> <1349754670-32009-11-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, Oct 09, 2012 at 02:51:01PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> Add a dquot buffer verify callback function and pass it into the
> buffer read functions. This checks all the dquots in a buffer, but
> cannot completely verify the dquot ids are correct. Also, errors
> cannot be repaired, so an additional function is added to repair bad
> dquots in the buffer if such an error is detected in a context where
> repair is allowed.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>

Looks good,

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

But after the first half dozen of callback I have a question:

> +             if (error) {
> +                     XFS_CORRUPTION_ERROR("xfs_dquot_read_verify",
> +                                          XFS_ERRLEVEL_LOW, mp, d);
> +                     xfs_buf_ioerror(bp, EFSCORRUPTED);
> +                     break;
> +             }
> +     }
> +     bp->b_iodone = NULL;
> +     xfs_buf_ioend(bp, 0);

It seems we always call xfs_buf_ioerror on errors, and then always
do a

        bp->b_iodone = NULL;
        xfs_buf_ioend(bp, 0);

for each callback.  What is the reason we can't take these two into the
core buffer cache code?

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