summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2012-05-10 23:30:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-10 23:30:35 -0700
commit418367112c96f6ce45aa142d613a575046b7f65f (patch)
tree1e47ea0b779595ee0cdfa9f75cfae1351b6ac5dc
parent1a673c868c2d2d81fcaeab34b4a7c75d4a978584 (diff)
parentcdc2a1c83575a349ee44035de8c3b38b8b401003 (diff)
downloadsystem_vold-418367112c96f6ce45aa142d613a575046b7f65f.tar.gz
system_vold-418367112c96f6ce45aa142d613a575046b7f65f.tar.bz2
system_vold-418367112c96f6ce45aa142d613a575046b7f65f.zip
Merge "Sleep to wait for dm to create node" into jb-dev
-rw-r--r--VolumeManager.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 4c1621b..f5c254f 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -948,6 +948,19 @@ int VolumeManager::mountAsec(const char *id, const char *key, int ownerUid) {
}
}
+ /*
+ * The device mapper node needs to be created. Sometimes it takes a
+ * while. Wait for up to 1 second. We could also inspect incoming uevents,
+ * but that would take more effort.
+ */
+ int tries = 25;
+ while (tries--) {
+ if (!access(dmDevice, F_OK) || errno != ENOENT) {
+ break;
+ }
+ usleep(40 * 1000);
+ }
+
int result;
if (sb.c_opts & ASEC_SB_C_OPTS_EXT4) {
result = Ext4::doMount(dmDevice, mountPoint, true, false, true);