2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2020 SUSE Linux Products GmbH. All Rights Reserved.
7 # Test if unmounting a fs with balance canceled can lead to crash.
8 # This needs CONFIG_BTRFS_DEBUG compiled, which adds extra unmount time self-test
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
23 kill $balance_pid &> /dev/null
24 kill $cancel_pid &> /dev/null
25 "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null
26 $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
30 # get standard environment, filters and checks
34 # remove previous $seqres.full before test
37 # real QA test starts here
39 # Modify as appropriate.
43 _require_command "$KILLALL_PROG" killall
45 _scratch_mkfs >> $seqres.full
52 trap "wait; exit" SIGTERM
54 _run_btrfs_balance_start &> /dev/null
60 trap "wait; exit" SIGTERM
62 $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
67 $FSSTRESS_PROG -d $SCRATCH_MNT -w -n 100000 >> $seqres.full 2>/dev/null &
78 "$KILLALL_PROG" -q $FSSTRESS_PROG &> /dev/null
79 $BTRFS_UTIL_PROG balance cancel $SCRATCH_MNT &> /dev/null
82 echo "Silence is golden"