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
26 # link correct .out file
27 _link_out_file $seq.out
31 _scratch_xfs_repair >$tmp.0 2>&1
34 echo "Repairing, iteration $i" | tee -a $seq.full
35 _scratch_xfs_repair 2>&1 | tee -a $seq.full >$tmp.$i
36 diff $tmp.0 $tmp.$i >> $seq.full
38 echo "ERROR: repair round $i differs (see $seq.full)"
41 # echo all interesting stuff...
43 s/(rebuilding directory inode) (\d+)/\1 INO/g;
44 s/internal log/<TYPEOF> log/g;
45 s/external log on \S+/<TYPEOF> log/g;
52 # prototype file to create various directory forms
58 # take inode size into account for non-shortform directories...
59 [ $total -gt 0 ] && total=`expr $total \* $isize / 512`
70 while [ $count -lt $total ]
72 count=`expr $count + 1`
73 cat >>$tmp.proto <<EOF
74 ${count}_of_${total}_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---755 3 1 /bin/true
80 # real QA test starts here
82 _supported_os IRIX Linux
87 # sanity test - default + one root directory entry
88 # Note: must do this proto/mkfs now for later inode size calcs
90 echo "=== one entry (shortform)"
91 _scratch_mkfs_xfs -p $tmp.proto >$tmp.mkfs0 2>&1
92 _filter_mkfs <$tmp.mkfs0 >/dev/null 2>$tmp.mkfs
96 # block-form root directory & repeat
98 echo "=== twenty entries (block form)"
99 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1
102 # leaf-form root directory & repeat
104 echo "=== thousand entries (leaf form)"
105 _scratch_mkfs_xfs -p $tmp.proto | _filter_mkfs >/dev/null 2>&1