generic: don't put loop control files on the scratch mount

If we're doing write/overwrite/snapshot/resource exhaustion tests on
the scratch device, use the test directory to hold the loop
termination signal files.  This way we don't run infinitely because
we can't create the flag due to ENOSPC.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2016-05-26 20:28:05 -07:00
committed by Eryu Guan
parent b5e26de924
commit 478f75b0d0
10 changed files with 64 additions and 40 deletions
+5 -3
View File
@@ -34,7 +34,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
rm -rf $tmp.*
rm -rf $tmp.* $finished_file
wait
}
@@ -54,6 +54,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
finished_file=/tmp/finished
rm -rf $finished_file
mkdir $testdir
loops=1024
@@ -68,7 +70,7 @@ _scratch_cycle_mount
# Snapshot creator...
snappy() {
n=0
while [ ! -e $testdir/finished ]; do
while [ ! -e $finished_file ]; do
out="$(_cp_reflink $testdir/file1 $testdir/snap_$n 2>&1)"
res=$?
echo "$out" | grep -q "No space left" && break
@@ -83,7 +85,7 @@ snappy &
seq $nr_loops -1 0 | while read i; do
_pwrite_byte 0x63 $((i * blksz)) $blksz -d $testdir/file1 >> $seqres.full
done
touch $testdir/finished
touch $finished_file
wait
# success, all done