2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2014 SUSE Linux Products GmbH. All Rights Reserved.
7 # Regression test for a btrfs issue where creation of readonly snapshots caused
8 # the filesystem to get into an inconsistent state.
10 # This regression was introduced in the 3.17 kernel and fixed by reverting the
11 # following linux kernel commit:
13 # Btrfs: race free update of commit root for ro snapshots
14 # 9c3b306e1c9e6be4be09e99a8fe2227d1005effc
17 _begin_fstest auto snapshot
21 # Override the default cleanup function.
27 # Import common functions.
30 # real QA test starts here
40 _scratch_mkfs >> $seqres.full 2>&1
43 snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
44 snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
45 run_check $FSSTRESS_PROG -p $procs \
46 -x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops
52 workout $ops $procs $snapshots
54 # The fstests framework runs a file system check against the scratch device
55 # automatically when a test case finishes (if the test calls _require_scratch).
56 # That filesystem check (btrfsck, btrfs.fsck) failed reporting several fs
57 # inconsistencies. Therefore there's no need to call _check_scratch_fs here.
59 echo "Silence is golden"