From 65f99c9e8bd3a546a5dd2f3f4bad1585afbf0dc8 Mon Sep 17 00:00:00 2001 From: Daniel Rosenberg Date: Tue, 28 Aug 2018 01:58:49 -0700 Subject: Add support for checkpointing Checkpointing uses a combination of files on the meta partition and the checkpoint= fs_mgr flag. Checkpointed partitions will revert to their starting state on reboot unless checkpoint commit is called. Test: Run vdc commands, check file on metadata Merged-In: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6 Change-Id: Icba16578608a6cbf922472e9d4ae5b8cf5f016c6 --- cryptfs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cryptfs.cpp') diff --git a/cryptfs.cpp b/cryptfs.cpp index 00e5519c..383bbe84 100644 --- a/cryptfs.cpp +++ b/cryptfs.cpp @@ -24,6 +24,7 @@ #include "cryptfs.h" +#include "Checkpoint.h" #include "EncryptInplace.h" #include "Ext4Crypt.h" #include "Keymaster.h" @@ -1562,7 +1563,9 @@ static int cryptfs_restart_internal(int restart_main) { SLOGE("Failed to setexeccon"); return -1; } - while ((mount_rc = fs_mgr_do_mount(fstab_default, DATA_MNT_POINT, crypto_blkdev, 0)) != 0) { + bool needs_cp = android::vold::cp_needsCheckpoint(); + while ((mount_rc = fs_mgr_do_mount(fstab_default, DATA_MNT_POINT, crypto_blkdev, 0, + needs_cp)) != 0) { if (mount_rc == FS_MGR_DOMNT_BUSY) { /* TODO: invoke something similar to Process::killProcessWithOpenFiles(DATA_MNT_POINT, -- cgit v1.2.3