xfs/271: fix test failure on non-reflink filesystems
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 Mar 2021 23:22:45 +0000 (15:22 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Mar 2021 16:32:16 +0000 (00:32 +0800)
commit5c076a5adbd15dc06128d7eea2747677b5eba704
tree275752eafc96707e1919e9a61dc781504bf2d7ce
parent71636cfbaf358931012d94fbaeed53ddfa6cea7d
xfs/271: fix test failure on non-reflink filesystems

This test creates an empty filesystem with rmap btrees enabled, and then
checks that GETFSMAP corresponds (roughly) with what we expect mkfs to
have written to the filesystem.

Unfortunately, the test's calculation for the number of "per-AG
metadata" extents is not quite correct.  For a filesystem with a
refcount btree, the rmapbt and agfl blocks will be reported separately,
but for non-reflink filesystems, GETFSMAP merges the records.

Since this test counts the number of records, fix the calculation.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/271