When a check in check_inode() failed, the test should umount test target
file system. This commit add clean up umount line in failure path.

Signed-off-by: Naohiro Aota <na...@elisp.net>
---
 tests/fsck-tests/012-leaf-corruption/test.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/fsck-tests/012-leaf-corruption/test.sh 
b/tests/fsck-tests/012-leaf-corruption/test.sh
index 6e23145..bfdd0ea 100755
--- a/tests/fsck-tests/012-leaf-corruption/test.sh
+++ b/tests/fsck-tests/012-leaf-corruption/test.sh
@@ -57,6 +57,7 @@ check_inode()
        # Check whether the inode exists
        exists=$($SUDO_HELPER find $path -inum $ino)
        if [ -z "$exists" ]; then
+               $SUDO_HELPER umount $TEST_MNT
                _fail "inode $ino not recovered correctly"
        fi
 
@@ -64,17 +65,20 @@ check_inode()
        found_mode=$(printf "%o" 0x$($SUDO_HELPER stat $exists -c %f))
        if [ $found_mode -ne $mode ]; then
                echo "$found_mode"
+               $SUDO_HELPER umount $TEST_MNT
                _fail "inode $ino modes not recovered"
        fi
 
        # Check inode size
        found_size=$($SUDO_HELPER stat $exists -c %s)
        if [ $mode -ne 41700 -a $found_size -ne $size ]; then
+               $SUDO_HELPER umount $TEST_MNT
                _fail "inode $ino size not recovered correctly"
        fi
 
        # Check inode name
        if [ "$(basename $exists)" != "$name" ]; then
+               $SUDO_HELPER umount $TEST_MNT
                _fail "inode $ino name not recovered correctly"
        else
                return 0
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to