xfs
[Top] [All Lists]

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

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/6] [XFS] Don't directly reference m_perag in allocation code
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 10 Dec 2009 18:18:56 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1259734299-20306-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1259734299-20306-1-git-send-email-david@xxxxxxxxxxxxx> <1259734299-20306-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
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/

> +             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.

Otherwise looks good.

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