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_local_device $SCRATCH_DEV
58 _require_scratch_shutdown
59 _require_command "$KILLALL_PROG" "killall"
63 echo "Silence is golden."
65 _scratch_mkfs >> $seqres.full 2>&1
66 _require_metadata_journaling $SCRATCH_DEV
67 _scratch_mount || _fail "mount failed"
69 for i in $(seq 1 $((50 * TIME_FACTOR)) ); do
70 ($FSSTRESS_PROG $FSSTRESS_AVOID -d $SCRATCH_MNT -n 999999 -p 4 >> $seqres.full &) \
73 # purposely include 0 second sleeps to test shutdown immediately after
78 ps -e | grep fsstress > /dev/null 2>&1
79 while [ $? -eq 0 ]; do
80 $KILLALL_PROG -9 fsstress > /dev/null 2>&1
82 ps -e | grep fsstress > /dev/null 2>&1
85 # quit if mount fails so we don't shutdown the host fs
86 _scratch_cycle_mount || _fail "cycle mount failed"