xfs
[Top] [All Lists]

Re: [PATCH] xfs_db: allow recalculating CRCs on invalid metadata

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs_db: allow recalculating CRCs on invalid metadata
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 12 May 2016 18:31:03 -0500
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20160512232804.GC18496@dastard>
References: <1463092513-5462-1-git-send-email-david@xxxxxxxxxxxxx> <ee586739-e804-8174-8497-cc8a992b9752@xxxxxxxxxxx> <20160512232804.GC18496@dastard>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.0

On 5/12/16 6:28 PM, Dave Chinner wrote:
>>> +
>>> > > +       if (corrupt) {
>>> > >                 nowrite_ops.verify_write = xfs_dummy_verify;
>>> > > -               iocur_top->bp->b_ops = &nowrite_ops;
>>> > > -               dbprintf(_("Allowing write of corrupted data\n"));
>>> > > +               dbprintf(_("Allowing write of corrupted data and bad 
>>> > > CRC\n"));
>>> > > +       } else {
>> > 
>> > Maybe a helpful/redundant comment about /* invalid_data */ alongside } 
>> > else { ?
> I though the dbprintf() documented it well enough? maybe move that
> to the top of each branch?

Oh, I suppose it does.  By the time we returned early on !corrupt & ! 
invalid_data,
then tested explicitly for (corrupt), it requires a decent brain-stack to 
remember what the } else { clause is for, IMHO.

But like I said, just a thought.

-Eric

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