[PATCH 2/6] [XFS] Don't directly reference m_perag in allocation code

Christoph Hellwig hch at infradead.org
Thu Dec 10 17:18:56 CST 2009


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.




More information about the xfs mailing list