Revert "Use lazy umount to unmount loopback devices."

This reverts CL:191524. This CL is suspected of breaking all
paladin builders, and some of the canaries.

BUG=chromium:353558
TEST=none

Change-Id: Ie1d692cde38c1183cb0e2e776e2785458f68d0e8
Reviewed-on: https://chromium-review.googlesource.com/191615
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/host/cros_generate_update_payload b/host/cros_generate_update_payload
index f7be074..df04253 100755
--- a/host/cros_generate_update_payload
+++ b/host/cros_generate_update_payload
@@ -46,102 +46,65 @@
 DST_ROOT=""
 STATE_MNT=""
 
-dump_umount_diags() {
+umount_with_retry() {
   local mnt_point="$1"
+  local ret=0
 
-  echo "cat /etc/mtab:"
-  sudo cat /etc/mtab
-  echo
-
-  echo "cat /proc/mounts:"
-  sudo cat /proc/mounts
-  echo
-
-  echo "fndmnt:"
-  sudo findmnt
-  echo
-
-  echo "lsof +D:"
-  sudo lsof +D "$mnt_point"
-  echo
-
-  echo "find:"
-  sudo find "$mnt_point"
-  echo
-
-  echo "fuser -vm:"
-  sudo fuser -vm "$mnt_point"
-  echo
-}
-
-umount_and_rmdir() {
-  local mnt_point="$1"
-
-  local err
-  local ret
-
-  [ -d  "$mnt_point" ] || return
+  if [ ! -d "$mnt_point" ]; then
+    return
+  fi
 
   for x in {1..10}; do
-    sudo umount -vl "$mnt_point"
-    ret=$?
-    if [ ${ret} -ne 0 ]; then
-      err=1
-      echo "sudo umount -vl ${mnt_point} exited with: $ret"
-      dump_umount_diags "${mnt_point}"
-    fi
-
-    sudo rmdir -v "$mnt_point"
+    sudo umount -v "$mnt_point"
+    echo "umount ${mnt_point} exited with: $?"
+    rmdir "$mnt_point"
     ret=$?
     if [ ${ret} -eq 0 ]; then
       break
-    else
-      err=1
-      echo "sudo rmdir -v ${mnt_point} exited with: $ret"
-      dump_umount_diags "${mnt_point}"
     fi
 
+    echo "fndmnt:"
+    sudo findmnt
+    echo
+
+    echo "lsof +D:"
+    sudo lsof +D "$mnt_point"
+    echo
+
+    echo "fuser -vm:"
+    sudo fuser -vm "$mnt_point"
+    echo
+
     sleep 60
-    echo "Retrying umount_and_rmdir ${mnt_point}"
+    echo "Retrying umount ${mnt_point}"
   done
 
-  return $err
+  echo "sudo umount -v ${mnt_point}: ${result}"
+
 }
 
 # Pass an arg to not exit 1 at the end
 cleanup() {
-  local err
-
   set +e
-
-  umount_and_rmdir "$SRC_MNT" || err=1
-  umount_and_rmdir "$DST_MNT" || err=1
-  umount_and_rmdir "$STATE_MNT" || err=1
-
+  umount_with_retry "$SRC_MNT"
   SRC_MNT=""
+  umount_with_retry "$DST_MNT"
   DST_MNT=""
+  umount_with_retry "$STATE_MNT"
   STATE_MNT=""
-
   if [ -z "$FLAGS_src_kern_path" ]; then
-    rm -f "$SRC_KERNEL" || err=1
+    rm -f "$SRC_KERNEL"
   fi
   if [ -z "$FLAGS_src_root_path" ]; then
-    rm -f "$SRC_ROOT" || err=1
+    rm -f "$SRC_ROOT"
   fi
   if [ -z "$FLAGS_kern_path" ]; then
-    rm -f "$DST_KERNEL" || err=1
+    rm -f "$DST_KERNEL"
   fi
   if [ -z "$FLAGS_root_path" ]; then
-    rm -f "$DST_ROOT" || err=1
+    rm -f "$DST_ROOT"
   fi
-
-  # If we are cleaning up after an error, or if we got an error during
-  # cleanup (even if we eventually succeeded) return a non-zero exit
-  # code. This triggers additional logging in most environments that call
-  # this script.
-  if [ -n "$1" -o -n "$err" ]; then
-    exit 1
-  fi
+  [ -n "$1" ] || exit 1
 }
 
 extract_partition_to_temp_file() {