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

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

Change-Id: Iabe97790ca7753d4de9c8c612e900b4e5b64238f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
David Anderson 2022-12-12 18:54:35 +00:00 committed by Automerger Merge Worker
commit d334e77348

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) {