2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test if the following workload would cause problem:
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
36 # Modify as appropriate.
38 _require_scratch_size $((5 * 1024 * 1024)) #kB
42 _scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full
45 # Fstrim to populate the device->alloc_status CHUNK_TRIMMED bits
46 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1 || \
47 _notrun "FSTRIM not supported"
50 # Shrink the fs to 4G, so the existing CHUNK_TRIMMED bits are beyond
52 $BTRFS_UTIL_PROG filesystem resize 1:-1G "$SCRATCH_MNT" >> $seqres.full
54 # Do fstrim again to trigger the bug
55 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full
57 echo "Silence is golden"