2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Oracle, Inc. All rights reserved.
7 # Make sure that the statfs b_avail counter doesn't change across remount
8 # after the rmapbt has grown in size.
11 _begin_fstest auto quick rmap
13 # Import common functions.
16 # remove previous \$seqres.full before test
18 # real QA test starts here
20 _require_xfs_io_command "falloc"
21 _require_test_program "punch-alternating"
22 _require_xfs_scratch_rmapbt
24 _scratch_mkfs >> $seqres.full
27 # Make sure we allocate a big enough file such that punching out every other
28 # block will cause the rmapbt to expand by at least one block.
29 blksz=$(_get_file_block_size $SCRATCH_MNT)
30 nr_rmap_per_rmapbt=$(( (blksz - 56) / 24))
31 blks=$(( (nr_rmap_per_rmapbt + 2) * 2))
32 $XFS_IO_PROG -f -c "falloc 0 $((blks * blksz))" $SCRATCH_MNT/a >> $seqres.full
33 $here/src/punch-alternating $SCRATCH_MNT/a
35 # Do the stat counters change across the remount?
36 before=$(stat -f -c '%b %f' $SCRATCH_MNT)
38 after=$(stat -f -c '%b %f' $SCRATCH_MNT)
40 if [ "${before}" != "${after}" ]; then
41 echo "counters changed: ${before} ${after}"
42 echo "before: ${before}" >> $seqres.full
43 echo "after: ${after}" >> $seqres.full
46 echo "Silence is golden."