2 # SPDX-License-Identifier: GPL-2.0
7 # Ext4 defragmentation stress test
8 # Perform defragmentation on file under buffered io
9 # while third task does direct io to donor file
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # get standard environment, filters and checks
25 # real QA test starts here
31 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
32 # We need space for 2 files (test file, and donor one)
33 # reserve 30% in order to avoid ENOSPC
34 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
36 cat >$fio_config <<EOF
37 # Common e4defrag regression tests
41 directory=${SCRATCH_MNT}
46 continue_on_error=write
49 ##########################################
51 # Perform defragmentation on file under buffered io
52 # while third task does direct io to donor file
54 # Continuous sequential defrag activity
64 numjobs=${LOAD_FACTOR}
65 runtime=30*${TIME_FACTOR}
68 # Run DIO/AIO for donor file
71 iodepth=128*${LOAD_FACTOR}
72 numjobs=${LOAD_FACTOR}
78 runtime=30*${TIME_FACTOR}
84 iodepth=128*${LOAD_FACTOR}
96 runtime=30*${TIME_FACTOR}
104 echo " Start defragment activity"
106 cat $fio_config >> $seqres.full
107 run_check $FIO_PROG $fio_config
110 _require_fio $fio_config
113 _scratch_mkfs >> $seqres.full 2>&1
117 _scratch_unmount 2>/dev/null
121 if ! _scratch_unmount; then
122 echo "failed to umount"