mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
cf89aed924
Fully scripted conversion, see script in initial SPDX license commit message. Signed-off-by: Dave Chinner <dchinner@redhat.com>
63 lines
1.3 KiB
Bash
Executable File
63 lines
1.3 KiB
Bash
Executable File
#! /bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# Copyright (c) 2009 Eric Sandeen. All Rights Reserved.
|
|
#
|
|
# FS QA Test No. 226
|
|
#
|
|
# Test for prealloc space leaks by rewriting the same file in a loop
|
|
#
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
|
|
_supported_fs generic
|
|
_supported_os Linux
|
|
_require_scratch
|
|
_require_odirect
|
|
|
|
# real QA test starts here
|
|
rm -f $seqres.full
|
|
|
|
_scratch_unmount 2>/dev/null
|
|
echo "--> mkfs 256m filesystem"
|
|
_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
|
|
_scratch_mount
|
|
|
|
loops=16
|
|
|
|
# Buffer size argument supplied to xfs_io "pwrite" command
|
|
buffer="-b $(expr 512 \* 1024)"
|
|
|
|
echo "--> $loops buffered 64m writes in a loop"
|
|
for I in `seq 1 $loops`; do
|
|
echo -n "$I "
|
|
$XFS_IO_PROG -f \
|
|
-c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
|
|
rm -f $SCRATCH_MNT/test
|
|
done
|
|
|
|
echo
|
|
_scratch_cycle_mount
|
|
|
|
echo "--> $loops direct 64m writes in a loop"
|
|
for I in `seq 1 $loops`; do
|
|
echo -n "$I "
|
|
$XFS_IO_PROG -f -d \
|
|
-c "pwrite ${buffer} 0 64m" $SCRATCH_MNT/test >> $seqres.full
|
|
rm -f $SCRATCH_MNT/test
|
|
done
|
|
|
|
echo
|
|
_scratch_unmount
|
|
|
|
status=0
|
|
exit
|