Currently, this test relies on the XFS_IOC_FSCOUNTS ioctl to return
accurate free space information. It doesn't. Convert it to use statfs,
which uses the accurate versions of the percpu counters. Obviously,
this only becomes a problem when we convert the free rtx count to use
(sloppier) percpu counters instead of the (more precise and previously
buggy) ondisk superblock counts.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
$here/src/punch-alternating $SCRATCH_MNT/bigfile -o $((punch_off / fsbsize)) -i $((rtextsize_blks * 2)) -s $rtextsize_blks
# Make sure we have some free rtextents.
-free_rtx=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep counts.freertx | awk '{print $3}')
+free_rtx=$($XFS_IO_PROG -c 'statfs' $SCRATCH_MNT | grep statfs.f_bavail | awk '{print $3}')
if [ $free_rtx -eq 0 ]; then
echo "Expected fragmented free rt space, found none."
fi