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 #-----------------------------------------------------------------------
27 owner=dmonakhov@openvz.org
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37 # get standard environment, filters and checks
41 # real QA test starts here
47 NUM_JOBS=$((4*LOAD_FACTOR))
48 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
49 if [ $((BLK_DEV_SIZE)) -gt 1048576 ]
53 FS_SIZE=$((BLK_DEV_SIZE * 512))
55 cat >$tmp-$seq.fio <<EOF
57 # $seq test fio activity
58 # Run DIO, fallocate and punch_hole threads on a single in parallel
60 # If race exist old dio request may rewrite punched block after it was
61 # allocated to another file, we will catch that by verifying blocks content
64 directory=${SCRATCH_MNT}
67 continue_on_error=write
75 ## Perform direct aio, to files which may be truncated
79 iodepth=128*${LOAD_FACTOR}
84 runtime=100*${TIME_FACTOR}
88 # Run falloc and punch_hole threads in parallel
89 # After activity file will be highly fragmented
92 runtime=100*${TIME_FACTOR}
94 bssplit=128k/80:512k/10:32k/10
101 runtime=100*${TIME_FACTOR}
109 # Verifier thread continiously write to newly allcated blocks
110 # and veryfy written content
113 iodepth=128*${LOAD_FACTOR}
124 filename=aio-dio-verifier
130 echo "Run fio with random aio-dio pattern"
132 cat $tmp-$seq.fio >> $seq.full
133 run_check $FIO_PROG $tmp-$seq.fio
136 _require_fio $tmp-$seq.fio
138 _scratch_mkfs_sized $FS_SIZE >> $seq.full 2>&1
142 umount $SCRATCH_DEV 2>/dev/null
146 if ! _scratch_unmount; then
147 echo "failed to umount"