btrfs/057: Fix false alerts due to orphan files
[xfstests-dev.git] / tests / btrfs / 057
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2014 Fujitsu.  All rights reserved.
4 #
5 # FSQA Test No. btrfs/057
6 #
7 # Quota rescan stress test, we run fsstress and quota rescan concurrently
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1
16
17 _cleanup()
18 {
19         cd /
20         rm -f $tmp.*
21 }
22 trap "_cleanup; exit \$status" 0 1 2 3 15
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs btrfs
30 _supported_os Linux
31 _require_scratch
32
33 rm -f $seqres.full
34
35 run_check _scratch_mkfs "-b 1g"
36
37 _scratch_mount
38
39 # -w ensures that the only ops are ones which cause write I/O
40 run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
41                 $FSSTRESS_AVOID >&/dev/null
42
43 _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
44         $SCRATCH_MNT/snap1
45
46 run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
47        $FSSTRESS_AVOID >&/dev/null
48
49 _run_btrfs_util_prog quota enable $SCRATCH_MNT
50 _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
51
52 echo "Silence is golden"
53 # btrfs check will detect any qgroup number mismatch.
54
55 status=0
56 exit