Use lazy umount to unmount loopback devices.

This is an attempt to work around crbug.com/353558, which is believed to
be caused by non-atomic umount, which is believed to be a kernel bug.

Switch to using lazy umounts, in the hope that it's a clean(ish) workaround.

Keep retry loops that will keep trying to cleanup the mount point directory
once a minute for up to 10 minutes.

Also, dump mount related debug info after every umount or rmdir failure to
help try and diagnose this.

In addition, if any command returns an error during the cleanup, make the
script return a non-zero exit code. This triggers additional logging in
most call sites for the script.

BUG=chromium:353558
TEST=Local payload generation.

Change-Id: I8ddaf8ddf2f072a404c1aa0ad9cdab84e2a73cbf
Reviewed-on: https://chromium-review.googlesource.com/191524
Tested-by: Don Garrett <dgarrett@chromium.org>
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: Don Garrett <dgarrett@chromium.org>
1 file changed