summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2012-10-09 14:16:59 -0700
committerThe Android Automerger <android-build@android.com>2012-10-09 16:20:51 -0700
commitf1a6123f9a05bdfe48129a9ed09ea6fcfe70e1f1 (patch)
tree9099cecf47d0f27c486594518b826bf68cde39c3
parent2a012c02b4e6a48076b9d26d9000389f338b8c19 (diff)
downloadsystem_vold-f1a6123f9a05bdfe48129a9ed09ea6fcfe70e1f1.zip
system_vold-f1a6123f9a05bdfe48129a9ed09ea6fcfe70e1f1.tar.gz
system_vold-f1a6123f9a05bdfe48129a9ed09ea6fcfe70e1f1.tar.bz2
Fix encryption on certain devices
There is a race in the encryption code that after it accepts the decryption password, it tells init to kill all the processes in class "main", then it mounts the decrypted filesystem, preps it, and restarts the framework. For an unknown reason on some devices, the new framework sometimes starts up before init has killed and reaped all the old processes. The proper fix is to make the killing of the old framework synchronous, so vold waits till all the processes have died. But with factory rom a few days away, the much more pragmatic solution of adding a sleep of 1 second after telling init to kill the old framework will suffice. Bug: 7271212 Change-Id: Ie971cd04abbc6f3f6500b4acd79d3b3b26d9561c
-rw-r--r--cryptfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cryptfs.c b/cryptfs.c
index 87ab281..67533a4 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -688,6 +688,9 @@ int cryptfs_restart(void)
property_set("vold.decrypt", "trigger_reset_main");
SLOGD("Just asked init to shut down class main\n");
+ /* Give everything a chance to shutdown */
+ sleep(1);
+
/* Now that the framework is shutdown, we should be able to umount()
* the tmpfs filesystem, and mount the real one.
*/