Lazy unmount postinstall if it fails to unmount.
If postinstall forks a new child that's not killed when killing the main
postinstall process or if postinstall makes any other running process to
hold a file descriptor open in the mounted filesystem, the filesystem is
busy an we can't unmount /postinstall. Since the postinstall mountpoint is
fix in Android, we need to force a lazy unmount in order for the process
to succeed in a future run.
This case can only occur when canceling an update during postinstall (for
example if the update was retried from the server) and would otherwise
clear itself after a few unmount retries if the process using the fd
stops using it.
Bug: 31021934
Test: Added native tests to excersice this case.
Change-Id: I69404658f481082b944f2ea6077e9a754a690ae6
2 files changed