public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V3
@ 2009-12-15  6:11 Dave Chinner
  2009-12-15  6:11 ` [PATCH 1/6] XFS: rename xfs_get_perag Dave Chinner
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Dave Chinner @ 2009-12-15  6:11 UTC (permalink / raw)
  To: xfs

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 3: Rebase for current upstream tree.
Version 2: Fix review comments from Christoph.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V2
@ 2009-12-14 23:11 Dave Chinner
  2009-12-14 23:11 ` [PATCH 4/6] XFS: convert remaining direct references to m_perag Dave Chinner
  0 siblings, 1 reply; 22+ messages in thread
From: Dave Chinner @ 2009-12-14 23:11 UTC (permalink / raw)
  To: xfs

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.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH 0/6] [XFS] Fix growfs deadlocks and per-AG use after free
@ 2009-12-02  6:11 Dave Chinner
  2009-12-02  6:11 ` [PATCH 4/6] [XFS] convert remaining direct references to m_perag Dave Chinner
  0 siblings, 1 reply; 22+ messages in thread
From: Dave Chinner @ 2009-12-02  6:11 UTC (permalink / raw)
  To: xfs

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.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2010-01-05 18:07 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15  6:11 [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V3 Dave Chinner
2009-12-15  6:11 ` [PATCH 1/6] XFS: rename xfs_get_perag Dave Chinner
2009-12-21 22:21   ` Alex Elder
2009-12-21 22:40     ` Dave Chinner
2009-12-15  6:11 ` [PATCH 2/6] XFS: Don't directly reference m_perag in allocation code Dave Chinner
2009-12-20  4:24   ` Dave Chinner
2009-12-22 14:18   ` Alex Elder
2009-12-15  6:11 ` [PATCH 3/6] XFS: Convert filestreams code to use per-ag get/put routines Dave Chinner
2009-12-22 15:08   ` [PATCH 3/6] XFS: Convert filestreams code to use per-ag get/putroutines Alex Elder
2009-12-15  6:11 ` [PATCH 4/6] XFS: convert remaining direct references to m_perag Dave Chinner
2009-12-23 20:49   ` Alex Elder
2009-12-15  6:11 ` [PATCH 5/6] XFS: Replace per-ag array with a radix tree Dave Chinner
2009-12-23 16:02   ` Christoph Hellwig
2009-12-23 22:08   ` Alex Elder
2009-12-26  4:17     ` Dave Chinner
2009-12-15  6:11 ` [PATCH 6/6] XFS: Reference count per-ag structures Dave Chinner
2009-12-23 22:12   ` Alex Elder
2009-12-20  4:28 ` [PATCH 7/6] XFS: Add trace points for per-ag refcount debugging Dave Chinner
2010-01-05 18:08   ` Alex Elder
  -- strict thread matches above, loose matches on Subject: below --
2009-12-14 23:11 [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V2 Dave Chinner
2009-12-14 23:11 ` [PATCH 4/6] XFS: convert remaining direct references to m_perag Dave Chinner
2009-12-02  6:11 [PATCH 0/6] [XFS] Fix growfs deadlocks and per-AG use after free Dave Chinner
2009-12-02  6:11 ` [PATCH 4/6] [XFS] convert remaining direct references to m_perag Dave Chinner
2009-12-10 23:24   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox