Merge "Populate the dm table of the early userdata device." am: 3937b479bd am: d334e77348

Original change: https://android-review.googlesource.com/c/platform/system/vold/+/2336136

Change-Id: I65c3cb33e0988f4212cb85600fc4cdda4d946382
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
David Anderson 2022-12-12 19:25:04 +00:00 committed by Automerger Merge Worker
commit 870ec56622

View file

@ -89,9 +89,18 @@ void defaultkey_precreate_dm_device() {
LOG(INFO) << "Not pre-creating userdata encryption device; device already exists";
return;
}
// On newer Linux kernels (5.15+), there is no uevent until DM_TABLE_LOAD,
// so we make sure the device is fully ready.
if (!dm.CreateEmptyDevice(kDmNameUserdata)) {
LOG(ERROR) << "Failed to pre-create userdata metadata encryption device";
}
DmTable table;
table.Emplace<DmTargetError>(0, 1);
if (!dm.LoadTable(kDmNameUserdata, table)) {
LOG(ERROR) << "Failed to pre-create userdata metadata encryption device";
}
}
static bool mount_via_fs_mgr(const char* mount_point, const char* blk_device) {