mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
7e98d41a6e
Refactor every test in the entire test suite to use the new boilerplate functions. This also migrates all the test group information into the test files. This patch has been autogenerated via the command: ./tools/convert-group btrfs ceph cifs ext4 f2fs generic nfs ocfs2 overlay perf shared udf xfs Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
62 lines
1.5 KiB
Bash
Executable File
62 lines
1.5 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (C) 2014 SUSE Linux Products GmbH. All Rights Reserved.
|
|
#
|
|
# FSQA Test No. 078
|
|
#
|
|
# Regression test for a btrfs issue where creation of readonly snapshots caused
|
|
# the filesystem to get into an inconsistent state.
|
|
#
|
|
# This regression was introduced in the 3.17 kernel and fixed by reverting the
|
|
# following linux kernel commit:
|
|
#
|
|
# Btrfs: race free update of commit root for ro snapshots
|
|
# 9c3b306e1c9e6be4be09e99a8fe2227d1005effc
|
|
#
|
|
. ./common/preamble
|
|
_begin_fstest auto snapshot
|
|
|
|
tmp=`mktemp -d`
|
|
|
|
# Override the default cleanup function.
|
|
_cleanup()
|
|
{
|
|
rm -fr $tmp
|
|
}
|
|
|
|
# Import common functions.
|
|
. ./common/filter
|
|
|
|
# real QA test starts here
|
|
_supported_fs btrfs
|
|
_require_scratch
|
|
|
|
workout()
|
|
{
|
|
ops=$1
|
|
procs=$2
|
|
num_snapshots=$3
|
|
|
|
_scratch_mkfs >> $seqres.full 2>&1
|
|
_scratch_mount
|
|
|
|
snapshot_cmd="$BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT"
|
|
snapshot_cmd="$snapshot_cmd $SCRATCH_MNT/snap_\`date +'%H_%M_%S_%N'\`"
|
|
run_check $FSSTRESS_PROG -p $procs \
|
|
-x "$snapshot_cmd" -X $num_snapshots -d $SCRATCH_MNT -n $ops
|
|
}
|
|
|
|
ops=8000
|
|
procs=4
|
|
snapshots=100
|
|
workout $ops $procs $snapshots
|
|
|
|
# The fstests framework runs a file system check against the scratch device
|
|
# automatically when a test case finishes (if the test calls _require_scratch).
|
|
# That filesystem check (btrfsck, btrfs.fsck) failed reporting several fs
|
|
# inconsistencies. Therefore there's no need to call _check_scratch_fs here.
|
|
|
|
echo "Silence is golden"
|
|
status=0
|
|
exit
|