2 # SPDX-License-Identifier: GPL-2.0
7 # Ext4 defragmentation stress test
8 # Defragment file while other task does direct io
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19 # get standard environment, filters and checks
24 # real QA test starts here
30 NUM_JOBS=$((4*LOAD_FACTOR))
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}
47 #################################
49 # Defragment file while other task does direct io
51 # Continious sequential defrag activity
61 runtime=30*${TIME_FACTOR}
67 iodepth=128*${LOAD_FACTOR}
79 runtime=30*${TIME_FACTOR}
86 echo " Start defragment activity"
88 cat $fio_config >> $seqres.full
89 run_check $FIO_PROG $fio_config
92 _require_fio $fio_config
95 _scratch_mkfs >> $seqres.full 2>&1
99 _scratch_unmount 2>/dev/null
103 if ! _scratch_unmount; then
104 echo "failed to umount"