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.
47 _require_command "$KILLALL_PROG" killall
49 echo "Silence is golden."
53 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
54 _scratch_mount "-o logbsize=32k"
56 # Run a workload to dirty the log, wait a bit and shutdown the fs.
57 $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
59 ./src/godown -f $SCRATCH_MNT
62 # Remount with a different log buffer size. Going from 32k to 64k increases the
63 # log record extended header count, as the log record header can only handle 32k
66 _try_scratch_mount "-o logbsize=64k"
68 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
69 # messages to detect failure in this case.
70 dmesg -c | grep XFS | grep CRC