2 # SPDX-License-Identifier: GPL-2.0
8 # Run random AIO/DIO activity on an file system with unwritten regions
10 # This test verifies that the an unwritten extent is properly marked
11 # as written after writing into it.
13 # There was a hard-to-hit bug which would occasionally trigger with
14 # ext4 for which this test was a reproducer. This has been fixed
15 # after moving ext4 to use iomap for Direct I/O's, although as of this
16 # writing, there are still some occasional failures on ext4 when block
20 _begin_fstest auto aio rw stress
25 # Import common functions.
28 # real QA test starts here
34 _require_block_device $SCRATCH_DEV
36 NUM_JOBS=$((4*LOAD_FACTOR))
37 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
38 FILE_SIZE=$(((BLK_DEV_SIZE * 512) * 3 / 4))
40 max_file_size=$((5 * 1024 * 1024 * 1024))
41 if [ $max_file_size -lt $FILE_SIZE ]; then
42 FILE_SIZE=$max_file_size
44 SIZE=$((FILE_SIZE / 2))
46 cat >$fio_config <<EOF
48 # $seq test fio activity
49 # Filenames derived from jobsname and jobid like follows:
50 # ${JOB_NAME}.${JOB_ID}.${ITERATION_ID}
54 directory=${SCRATCH_MNT}
58 iodepth=$((128*$LOAD_FACTOR))
61 # Perform direct aio and verify data
62 # This test case should check use-after-free issues
72 blocksize_range=4k-8200k
78 _require_fio $fio_config
79 _require_xfs_io_command "falloc"
81 _scratch_mkfs >> $seqres.full 2>&1
85 echo "Run fio with random aio-dio pattern"
87 cat $fio_config >> $seqres.full
88 $FIO_PROG $fio_config --output=$fio_out
89 cat $fio_out >> $seqres.full