@@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -30,7 +30,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -30,7 +30,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -32,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -33,7 +33,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -33,8 +33,8 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
-do_snapshot=/tmp/snapshot
+finished_file=$tmp.finished
+do_snapshot=$tmp.snapshot
rm -rf $finished_file
mkdir $testdir
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
wait
}
@@ -32,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -16,7 +16,8 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
+ [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1
wait
}
@@ -31,7 +32,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -57,6 +58,7 @@ overwrite() {
echo "Reflink and write the target"
overwrite &
+write_pid=$!
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
_reflink_range $testdir/file1 $((i * blksz)) \
@@ -66,6 +68,7 @@ seq 1 10 | while read j; do
done
touch $finished_file
wait
+unset write_pid
# success, all done
status=0
@@ -16,7 +16,8 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file
+ rm -rf $tmp.*
+ [ -n "$write_pid" ] && kill -9 $write_pid > /dev/null 2>&1
wait
}
@@ -32,7 +33,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -58,6 +59,7 @@ overwrite() {
echo "Reflink and dio write the target"
overwrite &
+write_pid=$!
seq 1 10 | while read j; do
seq 0 $nr_loops | while read i; do
_reflink_range $testdir/file1 $((i * blksz)) \
@@ -67,6 +69,7 @@ seq 1 10 | while read j; do
done
touch $finished_file
wait
+unset write_pid
# success, all done
status=0
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file $abort_file
+ rm -rf $tmp.*
wait
}
@@ -33,9 +33,9 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
-abort_file=/tmp/abort
+abort_file=$tmp.abort
rm -rf $abort_file
mkdir $testdir
@@ -16,7 +16,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $finished_file $abort_file
+ rm -rf $tmp.*
wait
}
@@ -32,9 +32,9 @@ _scratch_mkfs_sized $((400 * 1048576)) > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
-abort_file=/tmp/abort
+abort_file=$tmp.abort
rm -rf $abort_file
mkdir $testdir
@@ -32,7 +32,7 @@ _scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
-otherdir=/tmp/m.$seq
+otherdir=$tmp.m.$seq
othertestdir=$otherdir/test-$seq
rm -rf $otherdir
mkdir $otherdir
@@ -31,7 +31,7 @@ _scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
-otherdir=/tmp/m.$seq
+otherdir=$tmp.m.$seq
othertestdir=$otherdir/test-$seq
rm -rf $otherdir
mkdir $otherdir
@@ -23,7 +23,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -23,7 +23,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -22,7 +22,7 @@ _scratch_mkfs > $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
-finished_file=/tmp/finished
+finished_file=$tmp.finished
rm -rf $finished_file
mkdir $testdir
@@ -10,13 +10,6 @@
. ./common/preamble
_begin_fstest auto quick fiexchange
-# Override the default cleanup function.
-_cleanup()
-{
- cd /
- rm -r -f $tmp.* $dir
-}
-
# Import common functions.
. ./common/filter
. ./common/reflink
@@ -38,8 +31,8 @@ old_a=$(md5sum $SCRATCH_MNT/a | awk '{print $1}')
old_b=$(md5sum $SCRATCH_MNT/b | awk '{print $1}')
echo "md5 a: $old_a md5 b: $old_b" >> $seqres.full
-od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a0
-od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b0
+od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a0
+od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b0
echo swap >> $seqres.full
$XFS_IO_PROG -c "exchangerange -f $SCRATCH_MNT/a" $SCRATCH_MNT/b
@@ -53,8 +46,8 @@ echo "md5 a: $new_a md5 b: $new_b" >> $seqres.full
test $old_a = $new_b || echo "scratch file B doesn't match old file A"
test $old_b = $new_a || echo "scratch file A doesn't match old file B"
-od -tx1 -Ad -c $SCRATCH_MNT/a > /tmp/a1
-od -tx1 -Ad -c $SCRATCH_MNT/b > /tmp/b1
+od -tx1 -Ad -c $SCRATCH_MNT/a > $tmp.a1
+od -tx1 -Ad -c $SCRATCH_MNT/b > $tmp.b1
# success, all done
echo Silence is golden
@@ -15,7 +15,7 @@ _register_cleanup "_cleanup" BUS
_cleanup()
{
cd /
- rm -rf $tmp.* $testdir
+ rm -rf $tmp.*
}
# Import common functions.