4 # Regression test for a bug in the log record checksum mechanism of XFS. Log
5 # records are checksummed during recovery and a warning or mount failure occurs
6 # on checksum verification failure. XFS had a bug where the checksum mechanism
7 # verified different parts of a record depending on the current log buffer size.
8 # This caused spurious checksum failures when a filesystem is recovered using a
9 # different log buffer size from when the filesystem crashed.
11 # Test that log recovery succeeds with a different log buffer size from when the
14 #-----------------------------------------------------------------------
15 # Copyright (c) 2015 Red Hat, Inc. All Rights Reserved.
17 # This program is free software; you can redistribute it and/or
18 # modify it under the terms of the GNU General Public License as
19 # published by the Free Software Foundation.
21 # This program is distributed in the hope that it would be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License
27 # along with this program; if not, write the Free Software Foundation,
28 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 #-----------------------------------------------------------------------
33 seqres=$RESULT_DIR/$seq
34 echo "QA output created by $seq"
38 status=1 # failure is the default!
39 trap "_cleanup; exit \$status" 0 1 2 3 15
45 $KILLALL_PROG -9 fsstress > /dev/null 2>&1
51 # get standard environment, filters and checks
55 # real QA test starts here
57 # Modify as appropriate.
62 _require_command "$KILLALL_PROG" killall
64 echo "Silence is golden."
68 _scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
69 _scratch_mount "-o logbsize=32k"
71 # Run a workload to dirty the log, wait a bit and shutdown the fs.
72 $FSSTRESS_PROG -d $SCRATCH_MNT -p 4 -n 99999999 >> $seqres.full 2>&1 &
74 ./src/godown -f $SCRATCH_MNT
77 # Remount with a different log buffer size. Going from 32k to 64k increases the
78 # log record extended header count, as the log record header can only handle 32k
81 _scratch_mount "-o logbsize=64k"
83 # The mount may not fail on v4 filesystems. Check for CRC mismatch warning
84 # messages to detect failure in this case.
85 dmesg -c | grep XFS | grep CRC