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 _begin_fstest auto quick trim dangerous
15 # Import common functions.
18 # real QA test starts here
20 # Modify as appropriate.
22 _require_scratch_size $((5 * 1024 * 1024)) #kB
26 _scratch_mkfs_sized $((5 * 1024 * 1024 * 1024)) >> $seqres.full
29 # Fstrim to populate the device->alloc_status CHUNK_TRIMMED bits
30 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full 2>&1 || \
31 _notrun "FSTRIM not supported"
33 # Shrink the fs to 4G, so the existing CHUNK_TRIMMED bits are beyond
35 $BTRFS_UTIL_PROG filesystem resize 1:-1G "$SCRATCH_MNT" >> $seqres.full
37 # Do fstrim again to trigger the bug
38 $FSTRIM_PROG -v $SCRATCH_MNT >> $seqres.full
40 echo "Silence is golden"