if [ $sts -ne 0 ]; then
_dump_err_cont "[failed, exit status $sts]"
- _test_unmount 2>> $seqres.full
- _scratch_unmount 2>> $seqres.full
+ _test_unmount 2> /dev/null
+ _scratch_unmount 2> /dev/null
rm -f ${RESULT_DIR}/require_test*
rm -f ${RESULT_DIR}/require_scratch*
# Even though we failed, there may be something interesting in
_stash_test_status "$seqnum" "$tc_status"
done
+ # Reset these three variables so that unmount output doesn't get
+ # written to $seqres.full of the last test to run.
+ seq="check.$$"
+ check="$RESULT_BASE/check"
+ seqres="$check"
+
sect_stop=`_wallclock`
interrupt=false
_wrapup
_qmount()
{
- _scratch_unmount
+ _scratch_unmount >/dev/null 2>&1
_try_scratch_mount || _fail "qmount failed"
# xfs doesn't need these setups and quotacheck even fails on xfs
# redirect the output to $seqres.full for debug purpose and ignore results
}
# Unmount the filesystem based on the directory or device passed.
+# Log everything that happens to seqres.full, and use BASHPID because
+# background subshells have the same $$ as the parent but not the same
+# $BASHPID.
_unmount()
{
- local args="$*"
+ local outlog="$tmp.$BASHPID.umount"
+ local errlog="$tmp.$BASHPID.umount.err"
+
+ rm -f "$outlog" "$errlog"
+ $UMOUNT_PROG "$@" 2> "$errlog" > "$outlog"
+ local res="${PIPESTATUS[0]}"
- $UMOUNT_PROG $args >> $seqres.full 2>&1
+ if [ -s "$outlog" ]; then
+ cat "$outlog" >> $seqres.full
+ cat "$outlog"
+ fi
+ if [ -s "$errlog" ]; then
+ cat "$errlog" >> $seqres.full
+ >&2 cat "$errlog"
+ fi
+ rm -f "$outlog" "$errlog"
+ return $res
}
_scratch_unmount()
# expects an error, so open code the unmount
echo "unmounting read-only filesystem"
-$UMOUNT_PROG $SCRATCH_DEV 2>&1 | _filter_scratch | _filter_ending_dot
+_scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
#
# This is the way out if the underlying device really is read-only.
fi
# in case it's still suspended and/or mounted
$DMSETUP_PROG resume $lvdev >> $seqres.full 2>&1
- _unmount -q $SCRATCH_MNT
+ _unmount -q $SCRATCH_MNT >/dev/null 2>&1
_dmsetup_remove $node
}
# Override the default cleanup function.
_cleanup()
{
- _unmount $fs_mnt
+ _unmount $fs_mnt &>> /dev/null
[ -n "$loop_dev" ] && _destroy_loop_device $loop_dev
cd /
rm -f $tmp.*
# remount should not hang
$MOUNT_PROG -o remount,ro $fs_mnt >>$seqres.full 2>&1
-_unmount $fs_mnt
+_unmount $fs_mnt &>/dev/null
_destroy_loop_device $loop_dev
unset loop_dev
# Override the default cleanup function.
_cleanup()
{
- _scratch_unmount
+ _scratch_unmount &>/dev/null
[ -n "$loop_dev" ] && _destroy_loop_device $loop_dev
cd /
rm -f $tmp.*
done < $fiemap_after
echo "done."
-_unmount $loop_mnt
+_unmount $loop_mnt &>/dev/null
_destroy_loop_device $loop_dev
unset loop_dev
# Override the default cleanup function.
_cleanup()
{
- _unmount $mntdir
+ _unmount $mntdir &>/dev/null
[ -n "$loop_dev" ] && _destroy_loop_device $loop_dev
rmdir $mntdir
rm -f $loop_symlink
echo "Check filesystem"
_check_scratch_fs
-_scratch_unmount
+_scratch_unmount &> /dev/null
_destroy_loop_device $rt_loop_dev
unset rt_loop_dev