5 # Run random AIO/DIO activity and fallocate/punch_hole simultaneously
6 # Test will operate on huge sparsed file so ENOSPC is expected.
8 #-----------------------------------------------------------------------
9 # (c) 2013 Dmitry Monakhov
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35 # get standard environment, filters and checks
39 # real QA test starts here
45 NUM_JOBS=$((4*LOAD_FACTOR))
46 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
47 if [ $((BLK_DEV_SIZE)) -gt 1048576 ]
51 FS_SIZE=$((BLK_DEV_SIZE * 512))
53 cat >$tmp-$seq.fio <<EOF
55 # $seq test fio activity
56 # Run DIO, fallocate and punch_hole threads on a single in parallel
58 # If race exist old dio request may rewrite punched block after it was
59 # allocated to another file, we will catch that by verifying blocks content
62 directory=${SCRATCH_MNT}
65 continue_on_error=write
73 ## Perform direct aio, to files which may be truncated
77 iodepth=128*${LOAD_FACTOR}
82 runtime=100*${TIME_FACTOR}
86 # Run falloc and punch_hole threads in parallel
87 # After activity file will be highly fragmented
90 runtime=100*${TIME_FACTOR}
92 bssplit=128k/80:512k/10:32k/10
99 runtime=100*${TIME_FACTOR}
107 # Verifier thread continiously write to newly allcated blocks
108 # and veryfy written content
111 iodepth=128*${LOAD_FACTOR}
122 filename=aio-dio-verifier
128 echo "Run fio with random aio-dio pattern"
130 cat $tmp-$seq.fio >> $seq.full
131 run_check $FIO_PROG $tmp-$seq.fio
134 _require_fio $tmp-$seq.fio
136 _scratch_mkfs_sized $FS_SIZE >> $seq.full 2>&1
140 umount $SCRATCH_DEV 2>/dev/null
144 if ! _scratch_unmount; then
145 echo "failed to umount"