xfstests: loop devices vs umount stupidity

Unmounting a fileystem mounted on a loop device doesn't always tear
down the loop device. Its racy, and it causes tests to randomly
fail.

To avoid that, we have to use umount -d to ensure that we destroy
loop devices under filesystems in case the kernel doesn't tear it
down automatically to prevent the test from failing.  However, if
the kernel does tear it down automatically, umount now issues a
warning that it couldn't tear down the loop device because it
couldn't find it, and that causes the test to fail. *facepalm*

So, convert all the loop device unmounts to use -d, and direct the
output of all of them to /dev/null.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
Dave Chinner
2012-07-26 08:35:04 +00:00
committed by root
parent 427249fe4a
commit 1670bd4f34
6 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ _verify_copy()
echo unmounting and removing new image
umount $source_dir
umount -d $target_dir
umount -d $target_dir > /dev/null 2>&1
rm -f $target
}