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
25 # real QA test starts here
28 _scratch_unmount 2>/dev/null
29 echo "--> mkfs 256m filesystem"
30 _scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
35 # Buffer size argument supplied to xfs_io "pwrite" command
36 buffer="-b $(expr 512 \* 1024)"
38 echo "--> $loops buffered 64m writes in a loop"
39 for I in `seq 1 $loops`; do
42 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
43 rm -f $SCRATCH_MNT/test
49 echo "--> $loops direct 64m writes in a loop"
50 for I in `seq 1 $loops`; do
53 -c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
54 rm -f $SCRATCH_MNT/test