_cleanup()
{
umount $SCRATCH_MNT
- rm -f $tmp.*
+# rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
_require_scratch
-_do()
-{
- if [ $# -ne 1 ]; then echo "Usage: _do \"cmd\"" 1>&2 ; exit 1; fi
- echo "*** $1" >>$seq.full
- eval "$1 2>&1 | _fix_malloc >>$seq.full"
-}
-
_fill()
{
if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi
- echo -n "Fill filesystem... "
- _do "(src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest)"
- echo "done"
+ _do "Fill filesystem" \
+ "src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest"
}
+_do_die_on_error=y
rm -f $seq.full
#agsize=16
agsize=32
_do "umount $SCRATCH_MNT"
_do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT"
echo "done"
- echo -n "Check files... "
- if ! _do "src/fill2fs_check $tmp.manifest"; then
- echo "fail"
- echo "Files corrupt/missing after growfs. Test failed see $seq.full"
- status=1; exit
- fi
- echo "done"
-# echo -n "Checking filesystem... "
-# _check_fs $SCRATCH_DEV
-# echo "done"
+ _do "Check files" "src/fill2fs_check $tmp.manifest"
done
# success, all done
close MANIFEST;'
}
-_do()
-{
- if [ $# -ne 1 ]; then echo "Usage: _do \"cmd\"" 1>&2 ; exit 1; fi
- echo "*** $1" >>$seq.full
- eval "$1 2>&1 | _fix_malloc >>$seq.full"
-}
-
-
# create a large contiguous file using dd
# use fill2fs to fill the filesystem up with 4k sized files
# fill any remaining space using dd
# delete the dd-generated file
# run xfs_fsr on the filesystem
# check checksums for remaining files
-
# create 3 minimum sized (16Mb) allocation groups
# xfs_repair is going to need three to verify the superblock
rm -f $seq.full
done
echo "done"
echo -n "Fill filesystem with 4k files, generate manifest... "
-_do "(src/fill2fs --verbose --dir=$SCRATCH_MNT/fill --seed=0 --filesize=4096 --stddev=0 --list=$tmp.manifest)"
+_do "src/fill2fs --verbose --dir=$SCRATCH_MNT/fill --seed=0 --filesize=4096 --stddev=0 --list=$tmp.manifest"
echo "done"
echo -n "Use up any further available space using dd... "
_do "dd if=/dev/zero of=$SCRATCH_MNT/pad bs=4096"
_do "src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented"
echo "done"
_do "xfs_bmap $SCRATCH_MNT/fragmented"
-_do "(sum $SCRATCH_MNT/fragmented >$tmp.sum1)"
+_do "sum $SCRATCH_MNT/fragmented >$tmp.sum1"
echo -n "Remove other files... "
_do "rm -rf $SCRATCH_MNT/{pad,hole*}"
echo "done"
fi
echo "done"
echo -n "Check large file... "
-_do "(sum $SCRATCH_MNT/fragmented >$tmp.sum2)"
+_do "sum $SCRATCH_MNT/fragmented >$tmp.sum2"
if ! diff $tmp.sum1 $tmp.sum2; then
echo "fail"
echo "File is corrupt/missing after fsr. Test failed see $seq.full"