diff options
author | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-11-23 23:53:08 +0700 |
---|---|---|
committer | Pawit Pornkitprasan <p.pawit@gmail.com> | 2012-11-23 23:55:28 +0700 |
commit | 74f10db319aacb24b2750c77f0dacf947cb1b114 (patch) | |
tree | 2e34d39809651bfd524b8d5fad51d15a23d26832 | |
parent | 57e08d0966a86b8d42378e5d2e5f8c9a756b6da0 (diff) | |
download | system_vold-74f10db319aacb24b2750c77f0dacf947cb1b114.zip system_vold-74f10db319aacb24b2750c77f0dacf947cb1b114.tar.gz system_vold-74f10db319aacb24b2750c77f0dacf947cb1b114.tar.bz2 |
vold: do not try and unmount asec when unmounting non-primary storage
patch was lost in the merge
Change-Id: I9de6c2dc99c1484ac86fec7ee94eea5977a4aa11
-rw-r--r-- | Volume.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
@@ -657,24 +657,27 @@ int Volume::unmountVol(bool force, bool revert) { setState(Volume::State_Unmounting); usleep(1000 * 1000); // Give the framework some time to react - /* - * Remove the bindmount we were using to keep a reference to - * the previously obscured directory. - */ - if (doUnmount(Volume::SEC_ASECDIR_EXT, force)) { - SLOGE("Failed to remove bindmount on %s (%s)", SEC_ASECDIR_EXT, strerror(errno)); - goto fail_remount_tmpfs; - } + /* Undo createBindMounts(), which is only called for primary storage */ + if (isPrimaryStorage()) { + /* + * Remove the bindmount we were using to keep a reference to + * the previously obscured directory. + */ + if (doUnmount(Volume::SEC_ASECDIR_EXT, force)) { + SLOGE("Failed to remove bindmount on %s (%s)", SEC_ASECDIR_EXT, strerror(errno)); + goto fail_remount_tmpfs; + } - /* - * Unmount the tmpfs which was obscuring the asec image directory - * from non root users - */ - char secure_dir[PATH_MAX]; - snprintf(secure_dir, PATH_MAX, "%s/.android_secure", getMountpoint()); - if (doUnmount(secure_dir, force)) { - SLOGE("Failed to unmount tmpfs on %s (%s)", secure_dir, strerror(errno)); - goto fail_republish; + /* + * Unmount the tmpfs which was obscuring the asec image directory + * from non root users + */ + char secure_dir[PATH_MAX]; + snprintf(secure_dir, PATH_MAX, "%s/.android_secure", getMountpoint()); + if (doUnmount(secure_dir, force)) { + SLOGE("Failed to unmount tmpfs on %s (%s)", secure_dir, strerror(errno)); + goto fail_republish; + } } /* |