cryptfs: log beginning/end of each unmount attempt
Add more log messages to make it easier to understand failures in
wait_and_unmount().
Bug: 189250652
Change-Id: I621f54f30bb01cd52c4f9a74dba2d46b4d1a8a9d
diff --git a/cryptfs.cpp b/cryptfs.cpp
index 622d1f4..1dbd6f6 100644
--- a/cryptfs.cpp
+++ b/cryptfs.cpp
@@ -1525,6 +1525,7 @@
// Subdirectory mount will cause a failure of umount.
ensure_subdirectory_unmounted(mountpoint);
+ SLOGD("unmounting mount %s\n", mountpoint);
if (umount(mountpoint) == 0) {
break;
}
@@ -1533,10 +1534,12 @@
/* EINVAL is returned if the directory is not a mountpoint,
* i.e. there is no filesystem mounted there. So just get out.
*/
+ SLOGD("%s is not a mountpoint, nothing to do\n", mountpoint);
break;
}
err = errno;
+ SLOGW("unmounting mount %s failed: %s\n", mountpoint, strerror(err));
// If it's taking too long, kill the processes with open files.
//
@@ -1560,8 +1563,8 @@
SLOGD("unmounting %s succeeded\n", mountpoint);
rc = 0;
} else {
+ SLOGE("too many retries -- giving up unmounting %s\n", mountpoint);
android::vold::KillProcessesWithOpenFiles(mountpoint, 0);
- SLOGE("unmounting %s failed: %s\n", mountpoint, strerror(err));
rc = -1;
}