From 6e8440fd5072a673dd861ffb531fc17b4673ad90 Mon Sep 17 00:00:00 2001 From: Greg Hackmann Date: Thu, 2 Oct 2014 17:18:20 -0700 Subject: [PATCH] cryptfs: kill processes with open files on tmpfs /data cryptfs will fail to remount /data at boot if any processes (e.g. dex2oat) have files open on the tmpfs /data partition. Since these files are about to be destroyed anyway, just kill the offending processes: first with SIGHUP and finally with SIGKILL. Also remove a stray i++ that effectively cut the number of retries in half. Bug: 17576594 Change-Id: I76fb90ce2e52846ffb9de706e52b7bde98b4186a Signed-off-by: Greg Hackmann --- cryptfs.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/cryptfs.c b/cryptfs.c index 2878b20..606b9f1 100644 --- a/cryptfs.c +++ b/cryptfs.c @@ -1427,26 +1427,38 @@ static int create_encrypted_random_key(char *passwd, unsigned char *master_key, return encrypt_master_key(passwd, salt, key_buf, master_key, crypt_ftr); } -static int wait_and_unmount(char *mountpoint) +static int wait_and_unmount(char *mountpoint, bool kill) { int i, err, rc; #define WAIT_UNMOUNT_COUNT 20 /* Now umount the tmpfs filesystem */ for (i=0; i