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 modify it
12 # under the terms of version 2 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, but
16 # WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 # Further, this software is distributed without any warranty that it is
20 # free of the rightful claim of any third person regarding infringement
21 # or the like. Any license provided herein, whether implied or
22 # otherwise, applies only to this software file. Patent licenses, if
23 # any, provided herein do not apply to combinations of this program with
24 # other software, or any other product whatsoever.
26 # You should have received a copy of the GNU General Public License along
27 # with this program; if not, write the Free Software Foundation, Inc., 59
28 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
30 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
31 # Mountain View, CA 94043, or:
35 # For further information regarding this notice, see:
37 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
38 #-----------------------------------------------------------------------
41 owner=root@icy.melbourne.sgi.com
44 echo "QA output created by $seq"
48 status=1 # failure is the default!
49 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
51 # get standard environment, filters and checks
56 # real QA test starts here
57 rm -f $seq.full $tmp.*
61 umount $SCRATCH_DEV >/dev/null 2>&1
63 cat >$tmp.seq.params <<EOF
65 -lversion=2 -ologbsize=32k
66 -lversion=2,su=4096 -ologbsize=32k
67 -lversion=2,su=32768 -ologbsize=32k
69 # expect following line to fail
71 -lversion=2,su=36864 -ologbsize=32k
73 # following is not a power of 2 BBs
75 -lversion=2,su=5120 -ologbsize=32k
78 # Do the work for various log params which
79 # should not effect the data content of the log
80 # Try with and without sync'ing - sync'ing will mean that
81 # the log will be written out unfilled and thus the log
82 # stripe can have an effect.
84 for s in sync nosync ; do
86 | while read mkfs mnt restofline
88 if [ "$mkfs" = "#" ]; then
92 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
93 export MOUNT_OPTIONS=$mnt
94 export MKFS_OPTIONS=$mkfs
99 _echofull "mkfs failed: $MKFS_OPTIONS"
105 if ! _scratch_mount >>$seq.full 2>&1; then
106 _echofull "mount failed: $MOUNT_OPTIONS"
110 # create the metadata
111 if [ $s = "sync" ]; then
112 # generate some log traffic - but not too much
113 # add some syncs to get the log flushed to disk
114 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
119 # generate some log traffic - but not too much - life gets a little
120 # more complicated if the log wraps around. This traffic is
121 # pretty much arbitary, but could probably be made better than this.
122 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
125 # check before on what FS should look like
126 _echofull "ls $SCRATCH_MNT"
130 src/godown -v -f $SCRATCH_MNT >> $seq.full
133 umount $SCRATCH_DEV >>$seq.full 2>&1 \
134 || _fail "umount failed"
136 _echofull "logprint after going down..."
139 _echofull "mount with replay"
140 _scratch_mount >>$seq.full 2>&1 \
141 || _fail "mount failed: $MOUNT_OPTIONS"
143 # check on what FS looks like after log recovery
144 _echofull "ls $SCRATCH_MNT"
150 _echofull "logprint after mount and replay..."
153 if _check_scratch_fs; then
154 _echofull "filesystem is checked ok"
156 _echofull "filesystem is NOT ok"