xfs/294: calculate space to reserve for fragmentation test
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 7 May 2019 16:57:09 +0000 (09:57 -0700)
committerEryu Guan <guaneryu@gmail.com>
Fri, 10 May 2019 09:30:12 +0000 (17:30 +0800)
commitd123585ea0d092cc65102d10b63a4b5841f809e0
tree3240156d54b717134c1a2861943273089760a936
parent3f5941585839594e60fead828e095cb1510d8829
xfs/294: calculate space to reserve for fragmentation test

This test requires us to fragment free space, and in part accomplishes
this by fallocating 400M of a 512M filesystem, then fallocating another
70M, and then using dd to eat remaining space.  However, it's risky to
assume the 400M figure because new features such as reflink and rmap
have per-ag metadata reservations which add to overhead.  Therefore,
reserve the 70M fragment file first, then try to fallocate 95% of the
remaining free space.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Tested-by: Yang Xu<xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/294