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 seqres=$RESULT_DIR/$seq
19 echo "QA output created by $seq"
23 status=1 # failure is the default!
24 trap "_cleanup; exit \$status" 0 1 2 3 15
30 $KILLALL_PROG -9 fsstress > /dev/null 2>&1
36 # get standard environment, filters and checks
40 # real QA test starts here
42 # Modify as appropriate.
46 _require_command "$KILLALL_PROG" killall
48 echo "Silence is golden."
52 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
53 _scratch_mount "-o logbsize=32k"
55 # Run a workload to dirty the log, wait a bit and shutdown the fs.
56 $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
61 # Remount with a different log buffer size. Going from 32k to 64k increases the
62 # log record extended header count, as the log record header can only handle 32k
65 _try_scratch_mount "-o logbsize=64k"
67 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
68 # messages to detect failure in this case.
69 dmesg -c | grep XFS | grep CRC