2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Check data integrity during defrag compacting
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
22 # Disable all sync operations to get higher load
23 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
28 out=$SCRATCH_MNT/fsstress.$$
29 args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out`
30 echo "fsstress $args" >> $seqres.full
31 $FSSTRESS_PROG $args > /dev/null 2>&1
32 find $out -type f > $out.list
33 cat $out.list | xargs md5sum > $out.md5sum
34 usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'`
35 echo "Allocate donor file"
36 $XFS_IO_PROG -c "falloc 0 250M" -f $SCRATCH_MNT/donor | _filter_xfs_io
37 echo "Perform compacting"
38 cat $out.list | run_check $here/src/e4compact \
39 -i -v -f $SCRATCH_MNT/donor >> $seqres.full 2>&1
41 run_check md5sum -c $out.md5sum
44 # real QA test starts here
49 _require_xfs_io_command "falloc"
52 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1