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 seqres=$RESULT_DIR/$seq
21 echo "QA output created by $seq"
27 status=1 # failure is the default!
28 trap "_cleanup; exit \$status" 0 1 2 3 15
36 # get standard environment, filters and checks
40 # real QA test starts here
46 _require_block_device $SCRATCH_DEV
48 NUM_JOBS=$((4*LOAD_FACTOR))
49 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
50 FILE_SIZE=$(((BLK_DEV_SIZE * 512) * 3 / 4))
52 max_file_size=$((5 * 1024 * 1024 * 1024))
53 if [ $max_file_size -lt $FILE_SIZE ]; then
54 FILE_SIZE=$max_file_size
56 SIZE=$((FILE_SIZE / 2))
58 cat >$fio_config <<EOF
60 # $seq test fio activity
61 # Filenames derived from jobsname and jobid like follows:
62 # ${JOB_NAME}.${JOB_ID}.${ITERATION_ID}
66 directory=${SCRATCH_MNT}
70 iodepth=$((128*$LOAD_FACTOR))
73 # Perform direct aio and verify data
74 # This test case should check use-after-free issues
84 blocksize_range=4k-8200k
92 _require_fio $fio_config
93 _require_xfs_io_command "falloc"
95 _scratch_mkfs >> $seqres.full 2>&1
99 echo "Run fio with random aio-dio pattern"
101 cat $fio_config >> $seqres.full
102 $FIO_PROG $fio_config --output=$fio_out
103 cat $fio_out >> $seqres.full