aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2018-01-16 13:10:17 -0700
committerEryu Guan <eguan@redhat.com>2018-01-18 22:10:34 +0800
commit372e96e92ce570a75aa6d6cf1f39c05fc28e05d7 (patch)
tree5940dbfa3c5669c7a5156c569bdea5466639ae55
parentee55ddd38f016b2ca9d9dc67405b9fc36c07465d (diff)
downloadxfstests-dev-372e96e92ce570a75aa6d6cf1f39c05fc28e05d7.tar.gz
btrfs/011: umount device in _cleanup
btrfs/011 replaces the first device in SCRATCH_DEV_POOL in test, which is SCRATCH_DEV, and it fails to umount SCRATCH_MNT when it aborts, because _cleanup doesn't do any umount. This may leave SCRATCH_DEV not used but other devices from SCRATCH_DEV_POOL still mounted on SCRATCH_MNT. Then this results in SCRATCH_DEV unusable for subsequent tests because _require_scratch couldn't umount detect & umount SCRATCH_DEV correctly. Fix it by umounting SCRATCH_MNT in _cleanup, so the test always umounts the devices on exit. [eguan: add comments and rewrite summary and commit log] Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Tested-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rwxr-xr-xtests/btrfs/0114
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/btrfs/011 b/tests/btrfs/011
index 28f138843b..4aae22dc62 100755
--- a/tests/btrfs/011
+++ b/tests/btrfs/011
@@ -51,6 +51,10 @@ _cleanup()
fi
wait
rm -f $tmp.tmp
+ # we need this umount and couldn't rely on _require_scratch to umount
+ # it from next test, because we would replace SCRATCH_DEV, which is
+ # needed by _require_scratch, and make it umounted.
+ _scratch_unmount > /dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15