2 # SPDX-License-Identifier: GPL-2.0
8 # Run random AIO/DIO activity and fallocate/punch_hole simultaneously
9 # Test will operate on huge sparsed file so ENOSPC is expected.
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21 # get standard environment, filters and checks
25 # real QA test starts here
29 _require_block_device $SCRATCH_DEV
31 # xfs_io is not required for this test, but it's the best way to verify
32 # the test system supports fallocate() for allocation and hole punching
33 _require_xfs_io_command "falloc"
34 _require_xfs_io_command "fpunch"
38 NUM_JOBS=$((4*LOAD_FACTOR))
39 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
40 if [ $((BLK_DEV_SIZE)) -gt 1048576 ]
44 FS_SIZE=$((BLK_DEV_SIZE * 512))
46 cat >$fio_config <<EOF
48 # $seq test fio activity
49 # Run DIO, fallocate and punch_hole threads on a single in parallel
51 # If race exist old dio request may rewrite punched block after it was
52 # allocated to another file, we will catch that by verifying blocks content
55 directory=${SCRATCH_MNT}
58 continue_on_error=write
66 ## Perform direct aio, to files which may be truncated
70 iodepth=128*${LOAD_FACTOR}
75 runtime=100*${TIME_FACTOR}
79 # Run falloc and punch_hole threads in parallel
80 # After activity file will be highly fragmented
83 runtime=100*${TIME_FACTOR}
85 bssplit=128k/80:512k/10:32k/10
92 runtime=100*${TIME_FACTOR}
100 # Verifier thread continiously write to newly allcated blocks
101 # and veryfy written content
104 iodepth=128*${LOAD_FACTOR}
115 filename=aio-dio-verifier
121 echo "Run fio with random aio-dio pattern"
123 cat $fio_config >> $seqres.full
124 run_check $FIO_PROG $fio_config
127 _require_fio $fio_config
129 _scratch_mkfs_sized $FS_SIZE >> $seqres.full 2>&1
133 _scratch_unmount 2>/dev/null
137 if ! _scratch_unmount; then
138 echo "failed to umount"