2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Eric Sandeen. All Rights Reserved.
7 # Test for prealloc space leaks by rewriting the same file in a loop
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
18 # get standard environment, filters and checks
26 # real QA test starts here
29 _scratch_unmount 2>/dev/null
30 echo "--> mkfs 256m filesystem"
31 _scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
36 # Buffer size argument supplied to xfs_io "pwrite" command
37 buffer="-b $(expr 512 \* 1024)"
39 echo "--> $loops buffered 64m writes in a loop"
40 for I in `seq 1 $loops`; do
43 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
44 rm -f $SCRATCH_MNT/test
50 echo "--> $loops direct 64m writes in a loop"
51 for I in `seq 1 $loops`; do
54 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
55 rm -f $SCRATCH_MNT/test