aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZorro Lang <zlang@redhat.com>2021-10-24 20:05:12 +0800
committerEryu Guan <guaneryu@gmail.com>2021-11-14 18:46:01 +0800
commit1b5ab4ec6ad7928ecccb5346b0d6852ed4c6d8f3 (patch)
tree2fcae547a7845e125244dfbe49bed8fd305633a6
parent1adc9f01994c3cb1b1870eb5a55f31046b39e934 (diff)
downloadxfstests-dev-1b5ab4ec6ad7928ecccb5346b0d6852ed4c6d8f3.tar.gz
generic/648: dmerror must be unmounted
Sometimes g/648 fail to unmount dmerror with this error: umount: /mnt/xfstests/scratch: target is busy. Even worse, it will cause all later test cases fail as: mount: bad usage Try 'mount --help' for more information. check: failed to mount $SCRATCH_DEV using specified options Interrupted! So we shouldn't _fail directly if dmerror_unmount fails, use a while loop to try to unmount it enough times. Signed-off-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
-rwxr-xr-xtests/generic/64818
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/generic/648 b/tests/generic/648
index 83dd111dbc..e5c743c53c 100755
--- a/tests/generic/648
+++ b/tests/generic/648
@@ -104,7 +104,7 @@ for i in $(seq 1 $((25 * TIME_FACTOR)) ); do
wait > /dev/null 2>&1
ps -e | grep fsstress > /dev/null 2>&1
done
- for ((i = 0; i < 10; i++)); do
+ for ((j = 0; j < 10; j++)); do
test -e "$snap_aliveflag" || break
sleep 1
done
@@ -112,7 +112,21 @@ for i in $(seq 1 $((25 * TIME_FACTOR)) ); do
# Mount again to replay log after loading working table, so we have a
# consistent fs after test.
$UMOUNT_PROG $loopmnt
- _dmerror_unmount || _fail "iteration $i scratch unmount failed"
+ is_unmounted=1
+ # We must unmount dmerror at here, or whole later testing will crash.
+ # So try to umount enough times, before we have no choice.
+ for ((j = 0; j < 100; j++)); do
+ sleep 1
+ _dmerror_unmount > $tmp.unmount.err 2>&1
+ if [ $? -eq 0 ];then
+ is_unmounted=0
+ break
+ fi
+ done
+ if [ $is_unmounted -ne 0 ];then
+ cat $tmp.unmount.err
+ _fail "iteration $i scratch unmount failed"
+ fi
_dmerror_load_working_table
if ! _dmerror_mount; then
_metadump_dev $DMERROR_DEV $seqres.scratch.$i.md