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 _begin_fstest auto ioctl rw defrag prealloc
12 # Import common functions.
15 # Disable all sync operations to get higher load
16 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
21 out=$SCRATCH_MNT/fsstress.$$
22 args=`_scale_fsstress_args -p4 -n999 -f setattr=1 $FSSTRESS_AVOID -d $out`
23 echo "fsstress $args" >> $seqres.full
24 $FSSTRESS_PROG $args >> $seqres.full
25 find $out -type f > $out.list
26 cat $out.list | xargs md5sum > $out.md5sum
27 usage=`du -sch $out | tail -n1 | gawk '{ print $1 }'`
28 echo "Allocate donor file"
29 $XFS_IO_PROG -c "falloc 0 250M" -f $SCRATCH_MNT/donor | _filter_xfs_io
30 echo "Perform compacting"
31 cat $out.list | run_check $here/src/e4compact \
32 -i -v -f $SCRATCH_MNT/donor >> $seqres.full 2>&1
34 run_check md5sum -c $out.md5sum
37 # real QA test starts here
42 _require_xfs_io_command "falloc"
44 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1