xfs
[Top] [All Lists]

Re: [PATCH 2/6] xfs: shadow agfl indexes in the per-ag structures

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH 2/6] xfs: shadow agfl indexes in the per-ag structures
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 3 Sep 2016 09:06:12 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <d32c1b10-107c-a1fc-3864-76223661ab71@xxxxxxxxxxx>
References: <1472783257-15941-1-git-send-email-david@xxxxxxxxxxxxx> <1472783257-15941-3-git-send-email-david@xxxxxxxxxxxxx> <d32c1b10-107c-a1fc-3864-76223661ab71@xxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Sep 02, 2016 at 08:25:12AM -0500, Eric Sandeen wrote:
> On 9/1/16 9:27 PM, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@xxxxxxxxxx>
> > 
> > To verify that the AGFL contents is sane, we need to have access to
> > the indexes that tell us what part of the AGFL is active. We cannot
> > access the AGF buffer from the AGFL verifier, so we need to shadow
> > these values in the struct xfs_perag so we check them when required.
> > 
> > Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> > ---
> >  fs/xfs/libxfs/xfs_alloc.c | 4 ++++
> >  fs/xfs/xfs_mount.h        | 2 ++
> >  2 files changed, 6 insertions(+)
> > 
> > diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> > index 23559b9..1aef556 100644
> > --- a/fs/xfs/libxfs/xfs_alloc.c
> > +++ b/fs/xfs/libxfs/xfs_alloc.c
> > @@ -2255,6 +2255,7 @@ xfs_alloc_get_freelist(
> >     be32_add_cpu(&agf->agf_flcount, -1);
> >     xfs_trans_agflist_delta(tp, -1);
> >     pag->pagf_flcount--;
> > +   pag->pagf_flfirst = be32_to_cpu(agf->agf_flfirst);
> >     xfs_perag_put(pag);
> >  
> >     logflags = XFS_AGF_FLFIRST | XFS_AGF_FLCOUNT;
> 
> Still reviewing, but this kind of jumped out at me, seems like the get/put
> functions are a bit jumbled up:

Gets cleaned up in a later patch.

> sync, should there be a wrapper to encapsulate it all?
> 
> like:
> 
> xfs_agf_{advance/drop/remove}_first(mp, agf, pagf)

Not really necessary for single use functions whose express purpose
is manipulating the agfl indexes

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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