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.
10 #-----------------------------------------------------------------------
13 owner=root@icy.melbourne.sgi.com
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
23 # get standard environment, filters and checks
28 # real QA test starts here
30 _supported_os IRIX Linux
32 rm -f $seq.full $tmp.*
37 umount $SCRATCH_DEV >/dev/null 2>&1
39 cat >$tmp.seq.params <<EOF
41 # ------------------------------
42 version=2 logbsize=32k
43 version=2,su=4096 logbsize=32k
44 version=2,su=32768 logbsize=32k
45 version=2,su=32768 logbsize=64k
46 version=2 logbsize=64k
47 version=2,su=64k logbsize=64k
48 version=2 logbsize=128k
49 version=2,su=128k logbsize=128k
50 version=2 logbsize=256k
51 version=2,su=256k logbsize=256k
54 # Do the work for various log params which
55 # should not effect the data content of the log
56 # Try with and without sync'ing - sync'ing will mean that
57 # the log will be written out unfilled and thus the log
58 # stripe can have an effect.
60 for s in sync nosync ; do
62 | while read mkfs mnt restofline
64 if [ "$mkfs" = "#" ]; then
68 echo "--- mkfs=$mkfs, mnt=$mnt, sync=$s ---"
69 export MKFS_OPTIONS="-l $mkfs"
70 export MOUNT_OPTIONS="-o $mnt"
74 _scratch_mkfs_xfs >>$seq.full 2>&1
75 if [ $? -ne 0 ] ; then
76 _echofull "mkfs failed: $MKFS_OPTIONS"
82 if ! _scratch_mount >>$seq.full 2>&1; then
83 _echofull "mount failed: $MOUNT_OPTIONS"
88 if [ $s = "sync" ]; then
89 # generate some log traffic - but not too much
90 # add some syncs to get the log flushed to disk
91 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
96 # generate some log traffic - but not too much - life gets a little
97 # more complicated if the log wraps around. This traffic is
98 # pretty much arbitary, but could probably be made better than this.
99 touch $SCRATCH_MNT/{0,1,2,3,4,5,6,7,8,9}{0,1,2,3,4,5,6,7,8,9}
102 # check before on what FS should look like
103 _echofull "ls SCRATCH_MNT"
107 src/godown -v -f $SCRATCH_MNT >> $seq.full
110 umount $SCRATCH_DEV >>$seq.full 2>&1 \
111 || _fail "umount failed"
113 _echofull "logprint after going down..."
116 _echofull "mount with replay"
117 _scratch_mount >>$seq.full 2>&1 \
118 || _fail "mount failed: $MOUNT_OPTIONS"
120 # check on what FS looks like after log recovery
121 _echofull "ls SCRATCH_MNT"
127 _echofull "logprint after mount and replay..."
130 if _check_scratch_fs; then
131 _echofull "filesystem is checked ok"
133 _echofull "filesystem is NOT ok"