]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: adjust allocation length in xfs_alloc_space_available
authorChristoph Hellwig <hch@lst.de>
Wed, 11 Jan 2017 02:08:21 +0000 (20:08 -0600)
committerEric Sandeen <sandeen@redhat.com>
Wed, 11 Jan 2017 02:08:21 +0000 (20:08 -0600)
commit2c003dc253b4c8d4313c4f633ebc8ee649bf1d6b
treec4d9f1fe498ec227d06fd32c826c91412126470d
parenta3b4a951cbc39195b1fa85a950c415a1c54f4ef4
xfs: adjust allocation length in xfs_alloc_space_available

Source kernel commit: 54fee133ad59c87ab01dd84ab3e9397134b32acb

We must decide in xfs_alloc_fix_freelist if we can perform an
allocation from a given AG is possible or not based on the available
space, and should not fail the allocation past that point on a
healthy file system.

But currently we have two additional places that second-guess
xfs_alloc_fix_freelist: xfs_alloc_ag_vextent tries to adjust the
maxlen parameter to remove the reservation before doing the
allocation (but ignores the various minium freespace requirements),
and xfs_alloc_fix_minleft tries to fix up the allocated length
after we've found an extent, but ignores the reservations and also
doesn't take the AGFL into account (and thus fails allocations
for not matching minlen in some cases).

Remove all these later fixups and just correct the maxlen argument
inside xfs_alloc_fix_freelist once we have the AGF buffer locked.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_alloc.c
libxfs/xfs_alloc.h