xfs
[Top] [All Lists]

Re: [PATCH 2/6] [XFS] Don't directly reference m_perag in allocation cod

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/6] [XFS] Don't directly reference m_perag in allocation code
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Fri, 11 Dec 2009 10:41:24 +1100
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20091210231856.GB6389@xxxxxxxxxxxxx>
References: <1259734299-20306-1-git-send-email-david@xxxxxxxxxxxxx> <1259734299-20306-3-git-send-email-david@xxxxxxxxxxxxx> <20091210231856.GB6389@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Thu, Dec 10, 2009 at 06:18:56PM -0500, Christoph Hellwig wrote:
> On Wed, Dec 02, 2009 at 05:11:35PM +1100, Dave Chinner wrote:
> > +           pag = xfs_perag_get(mp, agno);
> > +           pag->pagf_freeblks += len;
> > +           xfs_perag_put(pag);
> > +
> >             agf = XFS_BUF_TO_AGF(agbp);
> > -           pag = &mp->m_perag[agno];
> >             be32_add_cpu(&agf->agf_freeblks, len);
> >             xfs_trans_agblocks_delta(tp, len);
> > -           pag->pagf_freeblks += len;
> 
> Currently not too deep into this code, but did you make sure moving the
> in-core addition before the logging of the transaction doesn't matter/

xfs_trans_agblocks_delta() is debug-only accounting, so moving the
perag update does not change anything. It's still changed inside
the AGF buffer lock, so should be correct.

> 
> > +           args->pag = xfs_perag_get(mp, args->agno);
> >             down_read(&mp->m_peraglock);
> > -           args->pag = &mp->m_perag[args->agno];
> 
> This adds another place where we could hit the growfs race until your
> later patches go in.

Ah, will fix up.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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