2 # FSQA Test No. btrfs/057
4 # Quota rescan stress test, we run fsstress and quota rescan concurrently
6 #-----------------------------------------------------------------------
7 # Copyright (C) 2014 Fujitsu. All rights reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
38 trap "_cleanup; exit \$status" 0 1 2 3 15
40 # get standard environment, filters and checks
44 # real QA test starts here
51 # use small leaf size to get higher btree height.
52 run_check _scratch_mkfs "-b 1g --nodesize 4096"
54 # inode cache is saved in the FS tree itself for every
55 # individual FS tree,that affects the sizes reported by qgroup show
56 # so we need to explicitly turn it off to get consistent values.
57 run_check _scratch_mount "-o noinode_cache"
59 # -w ensures that the only ops are ones which cause write I/O
60 run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p 5 -n 1000 \
61 $FSSTRESS_AVOID >&/dev/null
63 _run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
66 run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \
67 $FSSTRESS_AVOID >&/dev/null
69 _run_btrfs_util_prog quota enable $SCRATCH_MNT
70 _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
72 # ignore removing subvolume errors
73 rm -rf $SCRATCH_MNT/* >& /dev/null
75 _run_btrfs_util_prog filesystem sync $SCRATCH_MNT
76 units=`_btrfs_qgroup_units`
77 $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | $SED_PROG -n '/[0-9]/p' \
78 | $AWK_PROG '{print $2" "$3}'