xfs
[Top] [All Lists]

Re: [PATCH 12/32] xfs: verify AGF blocks as they are read from disk

To: Phil White <pwhite@xxxxxxx>
Subject: Re: [PATCH 12/32] xfs: verify AGF blocks as they are read from disk
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 13 Nov 2012 14:07:59 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20121113010900.GE27231@xxxxxxxxxxxxxxxxxxxx>
References: <1352721264-3700-1-git-send-email-david@xxxxxxxxxxxxx> <1352721264-3700-13-git-send-email-david@xxxxxxxxxxxxx> <20121113010900.GE27231@xxxxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Nov 12, 2012 at 05:09:00PM -0800, Phil White wrote:
> Dave, you botched a copy & paste here:
> 
> On Mon, Nov 12, 2012 at 10:54:04PM +1100, Dave Chinner wrote:
> > +   agf_ok = agf->agf_magicnum == cpu_to_be32(XFS_AGF_MAGIC) &&
> > +           XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) &&
> > +           be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) 
> > &&
> > +           be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) &&
> > +           be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) &&
> > +           be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp) &&
> > +           be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp);
> 
> See: 
> > -   agf_ok =
> > -           agf->agf_magicnum == cpu_to_be32(XFS_AGF_MAGIC) &&
> > -           XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) &&
> > -           be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) 
> > &&
> > -           be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) &&
> > -           be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) &&
> > -           be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp) &&
> > -           be32_to_cpu(agf->agf_seqno) == agno;

Good catch. :)

The agno is still checked in the new code, so it's just a double
check of the agf_flcount. i.e. no actual bug. I'll resend an updated
patch.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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