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
35 _require_xfs_io_command "falloc"
36 _require_test_program "punch-alternating"
37 _require_xfs_scratch_rmapbt
39 _scratch_mkfs >> $seqres.full
42 # Make sure we allocate a big enough file such that punching out every other
43 # block will cause the rmapbt to expand by at least one block.
44 blksz=$(_get_file_block_size $SCRATCH_MNT)
45 nr_rmap_per_rmapbt=$(( (blksz - 56) / 24))
46 blks=$(( (nr_rmap_per_rmapbt + 2) * 2))
47 $XFS_IO_PROG -f -c "falloc 0 $((blks * blksz))" $SCRATCH_MNT/a >> $seqres.full
48 $here/src/punch-alternating $SCRATCH_MNT/a
50 # Do the stat counters change across the remount?
51 before=$(stat -f -c '%b %f' $SCRATCH_MNT)
53 after=$(stat -f -c '%b %f' $SCRATCH_MNT)
55 if [ "${before}" != "${after}" ]; then
56 echo "counters changed: ${before} ${after}"
57 echo "before: ${before}" >> $seqres.full
58 echo "after: ${after}" >> $seqres.full
61 echo "Silence is golden."