Merge "Skip new userdata pre-create logic on kernels < 5.15."

This commit is contained in:
David Anderson 2022-12-15 17:26:59 +00:00 committed by Gerrit Code Review
commit 1bb7a963c0

View file

@ -90,15 +90,7 @@ void defaultkey_precreate_dm_device() {
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)) {
if (!dm.CreatePlaceholderDevice(kDmNameUserdata)) {
LOG(ERROR) << "Failed to pre-create userdata metadata encryption device";
}
}