OSDN Git Service

Make ext4 userdata checkpoints work with metadata encryption
authorPaul Lawrence <paullawrence@google.com>
Tue, 25 Jun 2019 21:36:52 +0000 (14:36 -0700)
committerPaul Lawrence <paullawrence@google.com>
Thu, 27 Jun 2019 17:42:51 +0000 (17:42 +0000)
commitd3aee48096dde6fd08bafc9ddb13618bec389996
treeeedfd029916a186129cfccbf507ef3a998c6e58c
parent64e64eb990cf9444ed8a38f96a32a3e7266d2984
Make ext4 userdata checkpoints work with metadata encryption

When both ext4 user data checkpoints and metadata encryption are
enabled, we are creating two stacked dm devices. This had not been
properly thought through or debugged.

Test: Enable metadata encryption on taimen (add
keydirectory=/metadata/vold/metadata_encryption to flags for userdata in
fstab.hardware)
    Unfortunately metadata is not wiped by fastboot -w, so it is
    necessary to rm metadata/vold -rf whenever you wipe data.
    fastboot flashall -w works
    fastboot reboot -w works
    A normal boot works
    Disable checkpoint commits with
    setprop persist.vold.dont_commit_checkpoint 1
    vdc checkpoint startCheckpoint 10
    adb reboot
    wait for device to fully boot then
    adb reboot
    Wait for device to fully boot then
    adb logcat -d | grep Checkpoint shows the rollback in the logs

    This tests encryption on top of checkpoints with commit, encryption
    without checkpoints, and rollback, which seems to be the key cases.

    Also ran same tests on unmodified Taimen and Blueline

Bug: 135905679
Merged-In: I24387a2943dce28b918c34894f24911b20429be7
Change-Id: I24387a2943dce28b918c34894f24911b20429be7
fs_mgr/fs_mgr.cpp
fs_mgr/include/fs_mgr.h