]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfs/187: don't rely on FSCOUNTS for free space data
authorDarrick J. Wong <djwong@kernel.org>
Mon, 11 Apr 2022 22:54:22 +0000 (15:54 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 17 Apr 2022 12:10:51 +0000 (20:10 +0800)
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>
tests/xfs/187

index 1929e566ac25a4268e3161515f82cd1a5f1a2f2c..a9dfb30a338dbb66ed6870d241e6a3b839472669 100755 (executable)
@@ -135,7 +135,7 @@ punch_off=$((bigfile_sz - frag_sz))
 $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