diff options
author | San Mehat <san@google.com> | 2010-02-24 11:43:22 -0800 |
---|---|---|
committer | San Mehat <san@google.com> | 2010-02-24 11:43:22 -0800 |
commit | 12f4b89046b54de1bdc188b7057ba77d7566e573 (patch) | |
tree | 75c1ce570a13a852a8721aa816334dbccd72e888 /VolumeManager.cpp | |
parent | 96956ed0e220cb62a4a96136976ded0d8c2d9075 (diff) | |
download | system_vold-12f4b89046b54de1bdc188b7057ba77d7566e573.zip system_vold-12f4b89046b54de1bdc188b7057ba77d7566e573.tar.gz system_vold-12f4b89046b54de1bdc188b7057ba77d7566e573.tar.bz2 |
vold: Retry rmdir of asec mount point
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'VolumeManager.cpp')
-rw-r--r-- | VolumeManager.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/VolumeManager.cpp b/VolumeManager.cpp index 0aa8c51..d4dad22 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -347,6 +347,7 @@ int VolumeManager::unmountAsec(const char *id, bool force) { break; } if (rc && (errno == EINVAL || errno == ENOENT)) { + LOGI("Secure container %s unmounted OK", id); rc = 0; break; } @@ -372,8 +373,19 @@ int VolumeManager::unmountAsec(const char *id, bool force) { return -1; } - if (rmdir(mountPoint)) { - LOGE("Failed to rmdir mountpoint (%s)", strerror(errno)); + int retries = 10; + + while(retries--) { + if (!rmdir(mountPoint)) { + break; + } + + LOGW("Failed to rmdir %s (%s)", mountPoint, strerror(errno)); + usleep(1000 * 1000); + } + + if (!retries) { + LOGE("Timed out trying to rmdir %s (%s)", mountPoint, strerror(errno)); } if (Devmapper::destroy(id) && errno != ENXIO) { @@ -698,7 +710,7 @@ int VolumeManager::unmountVolume(const char *label, bool force) { AsecIdCollection::iterator it = mActiveContainers->begin(); LOGI("Unmounting ASEC %s (dependant on %s)", *it, v->getMountpoint()); if (unmountAsec(*it, force)) { - LOGE("Failed to unmount ASEC %s (%s)", *it, strerror(errno), v->getMountpoint()); + LOGE("Failed to unmount ASEC %s (%s)", *it, strerror(errno)); return -1; } } |