Skip to content

XFS: Fix growfs deadlocks and per-AG use after free V3

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6XFS: rename xfs_get_peragfs/xfs/linux-2.6/xfs_sync.c fs/xfs/xfs_iget.c fs/xfs/xfs_inode.c +1 more+35 -242 replies
2/6XFS: Don't directly reference m_perag in allocation codefs/xfs/xfs_alloc.c fs/xfs/xfs_alloc_btree.c+52 -382 replies
3/6XFS: Convert filestreams code to use per-ag get/put routinesfs/xfs/xfs_filestream.c fs/xfs/xfs_filestream.h+36 -101 reply
4/6XFS: convert remaining direct references to m_peragfs/xfs/xfs_bmap.c fs/xfs/xfs_ialloc.c fs/xfs/xfs_inode.c +1 more+42 -151 reply
5/6XFS: Replace per-ag array with a radix treefs/xfs/xfs_alloc.c fs/xfs/xfs_bmap.c fs/xfs/xfs_filestream.c +5 more+86 -903 replies
6/6XFS: Reference count per-ag structuresfs/xfs/xfs_ag.h fs/xfs/xfs_mount.c fs/xfs/xfs_mount.h+12 -41 reply

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlex Elder
SeriesR-b
1/6
2/6R-b
3/6R-b
4/6
5/6
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] XFS: Fix growfs deadlocks and per-AG use after free V3

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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs