xfs
[Top] [All Lists]

Re: [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V2

To: xfs@xxxxxxxxxxx
Subject: Re: [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V2
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 15 Dec 2009 16:14:55 +1100
In-reply-to: <1260832270-14762-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1260832270-14762-1-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Dec 15, 2009 at 10:11:04AM +1100, Dave Chinner wrote:
> The use of an array for the xfs_perag structures results in growfs having
> to realocate the array. This requires exclusion to prevent use-after-free
> situations. The current locking is prone to deadlocks when growing under
> load, and the xfssyncd currently has no protection against the array being
> reallocated that can lead to panics.
> 
> This series abstracts the per-ag structure access and then removes the array
> to replace it with individual xfs_perag structures indexed by a radix tree.
> The only locking required is for the radix tree, hence the deadlocks go away
> as the tree lock is always the innermost lock. The use after frees go away
> as well as growfs does not need to reallocate structures fo pre-existing
> allocation groups - it only needs to allocate the structures for the new
> AGs and insert them into the tree.
> 
> This series also adds reference counting to the xfs-perag structure to
> ensure that we balance get/put accesses to the structures and provide the
> infrastructure to determine if the structure is in use or not.
> 
> Version 2: Fix review comments from Christoph.

This series needs updating after the trace patches were merged. I'll
post it again soon...

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

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