xfs
[Top] [All Lists]

Re: [PATCH 1/9] db: don't claim unchecked CRCs are correct

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/9] db: don't claim unchecked CRCs are correct
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 22 Apr 2014 09:13:08 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140421070009.GC20384@xxxxxxxxxxxxx>
References: <1397550301-31883-1-git-send-email-david@xxxxxxxxxxxxx> <1397550301-31883-2-git-send-email-david@xxxxxxxxxxxxx> <20140421070009.GC20384@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Apr 21, 2014 at 12:00:09AM -0700, Christoph Hellwig wrote:
> > +   switch (iocur_crc_valid()) {
> > +   case -1:
> > +           ok = "unchecked";
> > +           break;
> > +   case 0:
> > +           ok = "bad";
> > +           break;
> > +   case 1:
> > +           ok = "correct";
> > +           break;
> > +   default:
> > +           ok = "unknown state";
> > +           break;
> > +   }
> 
> We should have symbolic constants for these return values.  But then
> again iocur_crc_valid only has a single caller currently, is it even
> worth the effort, or should we simply inline it?

If we grow another user, I'll add an enum for it...

> Otherwise looks good,
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Thanks.

-- 
Dave Chinner
david@xxxxxxxxxxxxx

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