xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / btrfs / 078
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2014 SUSE Linux Products GmbH. All Rights Reserved.
4 #
5 # FSQA Test No. 078
6 #
7 # Regression test for a btrfs issue where creation of readonly snapshots caused
8 # the filesystem to get into an inconsistent state.
9 #
10 # This regression was introduced in the 3.17 kernel and fixed by reverting the
11 # following linux kernel commit:
12 #
13 #     Btrfs: race free update of commit root for ro snapshots
14 #     9c3b306e1c9e6be4be09e99a8fe2227d1005effc
15 #
16 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 tmp=`mktemp -d`
21 status=1        # failure is the default!
22 trap "_cleanup; exit \$status" 0 1 2 3 15
23
24 _cleanup()
25 {
26         rm -fr $tmp
27 }
28
29 # get standard environment, filters and checks
30 . ./common/rc
31 . ./common/filter
32
33 # real QA test starts here
34 _supported_fs btrfs
35 _supported_os Linux
36 _require_scratch
37
38 rm -f $seqres.full
39
40 workout()
41 {
42         ops=$1
43         procs=$2
44         num_snapshots=$3
45
46         _scratch_mkfs >> $seqres.full 2>&1
47         _scratch_mount
48
49         snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
50         snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
51         run_check $FSSTRESS_PROG -p $procs \
52             -x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops
53 }
54
55 ops=8000
56 procs=4
57 snapshots=100
58 workout $ops $procs $snapshots
59
60 # The fstests framework runs a file system check against the scratch device
61 # automatically when a test case finishes (if the test calls _require_scratch).
62 # That filesystem check (btrfsck, btrfs.fsck) failed reporting several fs
63 # inconsistencies. Therefore there's no need to call _check_scratch_fs here.
64
65 echo "Silence is golden"
66 status=0
67 exit