4 # exercise xfs_repair - ensure repeated use doesn't corrupt
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
22 # get standard environment, filters and checks
27 # link correct .out file
28 _link_out_file $seq.out
32 echo "Repairing, round 0" >> $seq.full
33 _scratch_xfs_repair 2>&1 | _filter_repair | tee -a $seq.full >$tmp.0
36 echo "Repairing, iteration $i" | tee -a $seq.full
37 _scratch_xfs_repair 2>&1 | _filter_repair >$tmp.$i
38 diff $tmp.0 $tmp.$i >> $seq.full
40 echo "ERROR: repair round $i differs to round 0 (see $seq.full)" | tee -a $seq.full
43 # echo all interesting stuff...
45 s/(rebuilding directory inode) (\d+)/\1 INO/g;
46 s/internal log/<TYPEOF> log/g;
47 s/external log on \S+/<TYPEOF> log/g;
54 # prototype file to create various directory forms
60 # take inode size into account for non-shortform directories...
61 [ $total -gt 0 ] && total=`expr $total \* $isize / 512`
72 while [ $count -lt $total ]
75 cat >>$tmp.proto <<EOF
76 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
82 # real QA test starts here
84 _supported_os IRIX Linux
89 # sanity test - default + one root directory entry
90 # Note: must do this proto/mkfs now for later inode size calcs
92 echo "=== one entry (shortform)"
93 _scratch_mkfs_xfs -p $tmp.proto >$tmp.mkfs0 2>&1
94 _filter_mkfs <$tmp.mkfs0 >/dev/null 2>$tmp.mkfs
98 # block-form root directory & repeat
100 echo "=== twenty entries (block form)"
101 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1
104 # leaf-form root directory & repeat
106 echo "=== thousand entries (leaf form)"
107 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1