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 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # remove previous \$seqres.full before test
32 # real QA test starts here
34 _require_xfs_io_command "falloc"
35 _require_test_program "punch-alternating"
36 _require_xfs_scratch_rmapbt
38 _scratch_mkfs >> $seqres.full
41 # Make sure we allocate a big enough file such that punching out every other
42 # block will cause the rmapbt to expand by at least one block.
43 blksz=$(_get_file_block_size $SCRATCH_MNT)
44 nr_rmap_per_rmapbt=$(( (blksz - 56) / 24))
45 blks=$(( (nr_rmap_per_rmapbt + 2) * 2))
46 $XFS_IO_PROG -f -c "falloc 0 $((blks * blksz))" $SCRATCH_MNT/a >> $seqres.full
47 $here/src/punch-alternating $SCRATCH_MNT/a
49 # Do the stat counters change across the remount?
50 before=$(stat -f -c '%b %f' $SCRATCH_MNT)
52 after=$(stat -f -c '%b %f' $SCRATCH_MNT)
54 if [ "${before}" != "${after}" ]; then
55 echo "counters changed: ${before} ${after}"
56 echo "before: ${before}" >> $seqres.full
57 echo "after: ${after}" >> $seqres.full
60 echo "Silence is golden."