4 # Test XFS log recovery ordering on v5 superblock filesystems. XFS had a problem
5 # where it would incorrectly replay older modifications from the log over more
6 # recent versions of metadata due to failure to update metadata LSNs during log
7 # recovery. This could result in false positive reports of corruption during log
8 # recovery and permanent mount failure.
10 # To test this situation, run frequent shutdowns immediately after log recovery.
11 # Ensure that log recovery does not recover stale modifications and cause
12 # spurious corruption reports and/or mount failures.
14 #-----------------------------------------------------------------------
15 # Copyright (c) 2016 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
46 _scratch_unmount > /dev/null 2>&1
49 # get standard environment, filters and checks
52 # Modify as appropriate.
57 _require_scratch_shutdown
58 _require_command "$KILLALL_PROG" "killall"
62 echo "Silence is golden."
64 _scratch_mkfs >> $seqres.full 2>&1
65 _scratch_mount || _fail "mount failed"
67 for i in $(seq 1 50); do
68 ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
71 # purposely include 0 second sleeps to test shutdown immediately after
74 ./src/godown $SCRATCH_MNT
76 ps -e | grep fsstress > /dev/null 2>&1
77 while [ $? -eq 0 ]; do
78 $KILLALL_PROG -9 fsstress > /dev/null 2>&1
80 ps -e | grep fsstress > /dev/null 2>&1
83 # quit if mount fails so we don't shutdown the host fs
84 _scratch_cycle_mount || _fail "cycle mount failed"