@@ -493,9 +493,8 @@ _check_filesystems()
if [ -f ${RESULT_DIR}/require_scratch ]; then
_check_scratch_fs || err=true
rm -f ${RESULT_DIR}/require_scratch*
- else
- _scratch_unmount 2> /dev/null
fi
+ _scratch_unmount 2> /dev/null
}
_expunge_test()
@@ -635,6 +634,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
echo "check: failed to mount \$SCRATCH_DEV using specified options"
status=1
exit
+ else
+ _scratch_unmount
fi
fi
@@ -753,6 +754,7 @@ for section in $HOST_OPTIONS_SECTIONS; do
# _check_dmesg depends on this log in dmesg
touch ${RESULT_DIR}/check_dmesg
fi
+ _try_wipe_scratch_devs > /dev/null 2>&1
if [ "$DUMP_OUTPUT" = true ]; then
./$seq 2>&1 | tee $tmp.out
# Because $? would get tee's return code
@@ -3991,6 +3991,15 @@ _require_fibmap()
rm -f $file
}
+_try_wipe_scratch_devs()
+{
+ test -x "$WIPEFS_PROG" || return 0
+
+ for dev in $SCRATCH_DEV_POOL $SCRATCH_DEV $SCRATCH_LOGDEV $SCRATCH_RTDEV; do
+ test -b $dev && $WIPEFS_PROG -a $dev
+ done
+}
+
init_rc
################################################################################
@@ -295,6 +295,7 @@ _require_xfs_db_command()
fi
command=$1
+ _scratch_mkfs_xfs >/dev/null 2>&1
_scratch_xfs_db -x -c "help" | grep $command > /dev/null || \
_notrun "xfs_db $command support is missing"
}