From: Su Yue <Damenly_Su@xxxxxxx>
The 034 test may fail to mount, and dmesg says open_ctree() failed due
to device missing.
The partly work flow is
step1 loop1 = losetup image1
step2 loop2 = losetup image2
setp3 mount loop1
The dmesg says the loop2 device is missing.
It's possible and known that while step3 is in open_ctree() and
fs_devices->opened is nonzero, loop2 device has not been added into the
fs_devces. Then read_one_chunk() reports that loop2 is missing.
The solution for this test is try to mount loop2 if loop mount failed.
Fixes: 0de2e22ad226 ("btrfs-progs: tests: Add tests for changing fsid feature")
Signed-off-by: Su Yue <Damenly_Su@xxxxxxx>
---
tests/misc-tests/034-metadata-uuid/test.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/misc-tests/034-metadata-uuid/test.sh b/tests/misc-tests/034-metadata-uuid/test.sh
index ff51bf22fadf..5fe553705fcf 100755
--- a/tests/misc-tests/034-metadata-uuid/test.sh
+++ b/tests/misc-tests/034-metadata-uuid/test.sh
@@ -173,7 +173,9 @@ failure_recovery() {
loop2=$(run_check_stdout $SUDO_HELPER losetup --find --show "$image2")
# Mount and unmount, on trans commit all disks should be consistent
- run_check $SUDO_HELPER mount "$loop1" "$TEST_MNT"
+ run_mayfail $SUDO_HELPER mount "$loop1" "$TEST_MNT"
+ [ $? -ne 0 ] && run_check $SUDO_HELPER mount "$loop2" "$TEST_MNT"
+
run_check $SUDO_HELPER umount "$TEST_MNT"
# perform any specific check
--
2.21.0 (Apple Git-122.2)