Prevent free space oversubscription and xfssyncd looping.
The fix for recent ENOSPC deadlocks introduced certain limitations
on allocations. The fix could cause xfssyncd to loop endlessly if
we did not leave some space free for the allocator to work
correctly. Basically, we needed to ensure that we had at least 4
blocks free for an AG free list and a block for the inode bmap btree
at all times.
However, this did not take into account the fact that each AG has a
free list that needs 4 blocks. Hence any filesystem with more than
one AG could cause oversubscription of free space and make xfssyncd
spin forever trying to allocate space needed for AG freelists that
was not available in the AG.
The following patch reserves space for the free lists in all AGs
plus the inode bmap btree which prevents oversubscription. It also
prevents those blocks from being reported as free space (as they can
never be used) and makes the SMP in-core superblock accounting code and
the reserved block ioctl respect this requirement.
Date: Thu Aug 31 16:14:16 AEST 2006
Inspected by: nathans
The following file(s) were checked into:
fs/xfs/xfs_vfsops.c - 1.510 - changed
- Don't report the space needed by the AG freelists as usable space.
fs/xfs/xfs_mount.c - 1.385 - changed
- Ensure we don't allocate the space we need for the AG freelists.
fs/xfs/xfs_alloc.h - 1.61 - changed
- Move definition of free space needed for AG free lists here.
fs/xfs/xfs_fsops.c - 1.119 - changed
- Prevent reserve space from using the space we need for AG freelists.