2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
7 # Regression test for a bug in the log record checksum mechanism of XFS. Log
8 # records are checksummed during recovery and a warning or mount failure occurs
9 # on checksum verification failure. XFS had a bug where the checksum mechanism
10 # verified different parts of a record depending on the current log buffer size.
11 # This caused spurious checksum failures when a filesystem is recovered using a
12 # different log buffer size from when the filesystem crashed.
14 # Test that log recovery succeeds with a different log buffer size from when the
18 _begin_fstest shutdown auto log quick
20 # Override the default cleanup function.
25 $KILLALL_PROG -9 fsstress > /dev/null 2>&1
29 # Import common functions.
32 # real QA test starts here
34 # Modify as appropriate.
38 _require_command "$KILLALL_PROG" killall
40 echo "Silence is golden."
44 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
45 _scratch_mount "-o logbsize=32k"
47 # Run a workload to dirty the log, wait a bit and shutdown the fs.
48 $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
53 # Remount with a different log buffer size. Going from 32k to 64k increases the
54 # log record extended header count, as the log record header can only handle 32k
57 _try_scratch_mount "-o logbsize=64k"
59 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
60 # messages to detect failure in this case.
61 dmesg -c | grep XFS | grep CRC