Merge "MetadataCrypt: fix timeout due to missing userdata dm device" am: df2bc1025b am: 1b2cac19c8 am: 28d183be21

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

Change-Id: I5c63dfad6008a066c3fb222f5eb3c19fd32f962c
This commit is contained in:
Treehugger Robot 2021-12-24 01:37:21 +00:00 committed by Automerger Merge Worker
commit 53ae3cb110

View file

@ -187,15 +187,14 @@ static bool create_crypto_blk_dev(const std::string& dm_name, const std::string&
auto& dm = DeviceMapper::Instance();
if (dm_name == kDmNameUserdata && dm.GetState(dm_name) == DmDeviceState::SUSPENDED) {
// The device was created in advance, populate it now.
std::string path;
if (!dm.WaitForDevice(dm_name, 5s, crypto_blkdev)) {
LOG(ERROR) << "Failed to wait for default-key device " << dm_name;
return false;
}
if (!dm.LoadTableAndActivate(dm_name, table)) {
LOG(ERROR) << "Failed to populate default-key device " << dm_name;
return false;
}
if (!dm.WaitForDevice(dm_name, 5s, crypto_blkdev)) {
LOG(ERROR) << "Failed to wait for default-key device " << dm_name;
return false;
}
} else if (!dm.CreateDevice(dm_name, table, crypto_blkdev, 5s)) {
LOG(ERROR) << "Could not create default-key device " << dm_name;
return false;