3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # exercise xfs_repair - ensure repeated use doesn't corrupt
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
42 # link correct .out file
43 _link_out_file $seq.out
47 echo "Repairing, round 0" >> $seq.full
48 _scratch_xfs_repair 2>&1 | _filter_repair | tee -a $seq.full >$tmp.0
51 echo "Repairing, iteration $i" | tee -a $seq.full
52 _scratch_xfs_repair 2>&1 | _filter_repair >$tmp.$i
53 diff $tmp.0 $tmp.$i >> $seq.full
55 echo "ERROR: repair round $i differs to round 0 (see $seq.full)" | tee -a $seq.full
58 # echo all interesting stuff...
60 s/(rebuilding directory inode) (\d+)/\1 INO/g;
61 s/internal log/<TYPEOF> log/g;
62 s/external log on \S+/<TYPEOF> log/g;
69 # prototype file to create various directory forms
75 # take inode size into account for non-shortform directories...
76 [ $total -gt 0 ] && total=`expr $total \* $isize / 512`
87 while [ $count -lt $total ]
90 cat >>$tmp.proto <<EOF
91 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
97 # real QA test starts here
99 _supported_os IRIX Linux
104 # sanity test - default + one root directory entry
105 # Note: must do this proto/mkfs now for later inode size calcs
107 echo "=== one entry (shortform)"
108 _scratch_mkfs_xfs -p $tmp.proto >$tmp.mkfs0 2>&1
109 _filter_mkfs <$tmp.mkfs0 >/dev/null 2>$tmp.mkfs
113 # block-form root directory & repeat
115 echo "=== twenty entries (block form)"
116 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1
119 # leaf-form root directory & repeat
121 echo "=== thousand entries (leaf form)"
122 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1