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
32 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
33 # We need space for 2 files (test file, and donor one)
34 # reserve 30% in order to avoid ENOSPC
35 FILE_SIZE=$((BLK_DEV_SIZE * (512 / (2 + 1))))
37 cat >$fio_config <<EOF
38 # Common e4defrag regression tests
42 directory=${SCRATCH_MNT}
47 continue_on_error=write
50 ##########################################
52 # Perform defragmentation on file under buffered io
53 # while third task does direct io to donor file
55 # Continuous sequential defrag activity
65 numjobs=${LOAD_FACTOR}
66 runtime=30*${TIME_FACTOR}
69 # Run DIO/AIO for donor file
72 iodepth=128*${LOAD_FACTOR}
73 numjobs=${LOAD_FACTOR}
79 runtime=30*${TIME_FACTOR}
85 iodepth=128*${LOAD_FACTOR}
97 runtime=30*${TIME_FACTOR}
105 echo " Start defragment activity"
107 cat $fio_config >> $seqres.full
108 run_check $FIO_PROG $fio_config
111 _require_fio $fio_config
114 _scratch_mkfs >> $seqres.full 2>&1
118 _scratch_unmount 2>/dev/null
122 if ! _scratch_unmount; then
123 echo "failed to umount"