Skip to contentSkip to conversation

Fstests: btrfs/027 unmount scratch device if test fails

PATCH New Liu Bo 1 participant 1 message Jan 16, 2018

lore
Share & tools
lore

Liu Bo

author
#0 lore raw

PATCH 1/1 Fstests: btrfs/027 unmount scratch device if test fails

This test, btrfs/027, runs tests against different raid profiles in a loop, if one of them aborts, it also fails the following ones with errors like,

Test -m raid10 -d raid10
ERROR: /dev/xxx is mounted
Test -m raid5 -d raid5
ERROR: /dev/xxx is mounted
Test -m raid6 -d raid6
ERROR: /dev/xxx is mounted

_scratch_unmount is added to avoid the above.

---
 tests/btrfs/027 | 2 ++
 1 file changed, 2 insertions(+)
tests/btrfs/027 +2 -0
index 625a27f..689cd4c 100755
@@ -95,6 +95,7 @@ run_test()
 		$SCRATCH_MNT >>$seqres.full 2>&1
 	if [ $? -ne 0 ]; then
 		echo "btrfs replace failed"
+		_scratch_unmount
 		_spare_dev_put
 		_scratch_dev_pool_put
 		return
@@ -102,6 +103,7 @@ run_test()
 	$BTRFS_UTIL_PROG scrub start -B $SCRATCH_MNT >>$seqres.full 2>&1
 	if [ $? -ne 0 ]; then
 		echo "btrfs scrub failed"
+		_scratch_unmount
 		_spare_dev_put
 		_scratch_dev_pool_put
 		return
Signature · 1 line
2.5.0