4 # To test log replay with version 2 logs
5 # Initially keep this simple with just creates.
6 # In another qa test we can do more e.g. use fsstress.
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
27 owner=root@icy.melbourne.sgi.com
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
42 # real QA test starts here
44 _supported_os IRIX Linux
46 rm -f $seq.full $tmp.*
51 umount $SCRATCH_DEV >/dev/null 2>&1
53 cat >$tmp.seq.params <<EOF
55 # ------------------------------
56 version=2 logbsize=32k
57 version=2,su=4096 logbsize=32k
58 version=2,su=32768 logbsize=32k
59 version=2,su=32768 logbsize=64k
60 version=2 logbsize=64k
61 version=2,su=64k logbsize=64k
62 version=2 logbsize=128k
63 version=2,su=128k logbsize=128k
64 version=2 logbsize=256k
65 version=2,su=256k logbsize=256k
68 # Do the work for various log params which
69 # should not effect the data content of the log
70 # Try with and without sync'ing - sync'ing will mean that
71 # the log will be written out unfilled and thus the log
72 # stripe can have an effect.
74 for s in sync nosync ; do
76 | while read mkfs mnt restofline
78 if [ "$mkfs" = "#" ]; then
82 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
83 export MKFS_OPTIONS="-l $mkfs"
84 export MOUNT_OPTIONS="-o $mnt"
88 _scratch_mkfs_xfs >>$seq.full 2>&1
89 if [ $? -ne 0 ] ; then
90 _echofull "mkfs failed: $MKFS_OPTIONS"
96 if ! _scratch_mount >>$seq.full 2>&1; then
97 _echofull "mount failed: $MOUNT_OPTIONS"
101 # create the metadata
102 if [ $s = "sync" ]; then
103 # generate some log traffic - but not too much
104 # add some syncs to get the log flushed to disk
105 for file in $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}; do
110 # generate some log traffic - but not too much - life gets a little
111 # more complicated if the log wraps around. This traffic is
112 # pretty much arbitary, but could probably be made better than this.
113 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
116 # check before on what FS should look like
117 _echofull "ls SCRATCH_MNT"
121 src/godown -v -f $SCRATCH_MNT >> $seq.full
124 umount $SCRATCH_DEV >>$seq.full 2>&1 \
125 || _fail "umount failed"
127 _echofull "logprint after going down..."
130 _echofull "mount with replay"
131 _scratch_mount >>$seq.full 2>&1 \
132 || _fail "mount failed: $MOUNT_OPTIONS"
134 # check on what FS looks like after log recovery
135 _echofull "ls SCRATCH_MNT"
141 _echofull "logprint after mount and replay..."
144 if _check_scratch_fs; then
145 _echofull "filesystem is checked ok"
147 _echofull "filesystem is NOT ok"