Files
apfstests/tests/xfs/079
T
Darrick J. Wong 58937c3f24 fstests: use _scratch_shutdown instead of calling src/godown
Overlayfs introduces some complexity with regards to what path we have
to use to shut down the scratch filesystem: it's SCRATCH_MNT for regular
filesystems, but it's OVL_BASE_SCRATCH_MNT (i.e. the lower mount of the
overlay) if overlayfs is enabled.  The helper works through all that, so
we might as well use it.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2019-05-24 17:18:35 +08:00

75 lines
1.9 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test No. 079
#
# Regression test for a bug in the log record checksum mechanism of XFS. Log
# records are checksummed during recovery and a warning or mount failure occurs
# on checksum verification failure. XFS had a bug where the checksum mechanism
# verified different parts of a record depending on the current log buffer size.
# This caused spurious checksum failures when a filesystem is recovered using a
# different log buffer size from when the filesystem crashed.
#
# Test that log recovery succeeds with a different log buffer size from when the
# filesystem crashed.
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
$KILLALL_PROG -9 fsstress > /dev/null 2>&1
wait > /dev/null 2>&1
}
rm -f $seqres.full
# get standard environment, filters and checks
. ./common/rc
. ./common/log
# real QA test starts here
# Modify as appropriate.
_supported_fs xfs
_supported_os Linux
_require_scratch
_require_v2log
_require_command "$KILLALL_PROG" killall
echo "Silence is golden."
dmesg -c > /dev/null
_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
_scratch_mount "-o logbsize=32k"
# Run a workload to dirty the log, wait a bit and shutdown the fs.
$FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
sleep 10
_scratch_shutdown -f
wait
# Remount with a different log buffer size. Going from 32k to 64k increases the
# log record extended header count, as the log record header can only handle 32k
# of space.
_scratch_unmount
_try_scratch_mount "-o logbsize=64k"
# The mount may not fail on v4 filesystems. Check for CRC mismatch warning
# messages to detect failure in this case.
dmesg -c | grep XFS | grep CRC
# success, all done
status=0
exit