Merge "fastbootd: sync() after flashing partitions or updating super" am: 8890d42939

Change-Id: I51ffae77484fea37221e80b4164153d70d31aacf
This commit is contained in:
Tom Cherry 2020-03-31 22:04:12 +00:00 committed by Automerger Merge Worker
commit 641282d0da

View file

@ -135,7 +135,9 @@ int Flash(FastbootDevice* device, const std::string& partition_name) {
return -EOVERFLOW;
}
WipeOverlayfsForPartition(device, partition_name);
return FlashBlockDevice(handle.fd(), data);
int result = FlashBlockDevice(handle.fd(), data);
sync();
return result;
}
bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wipe) {
@ -165,6 +167,7 @@ bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wip
return device->WriteFail("Unable to flash new partition table");
}
fs_mgr_overlayfs_teardown();
sync();
return device->WriteOkay("Successfully flashed partition table");
}
@ -204,5 +207,6 @@ bool UpdateSuper(FastbootDevice* device, const std::string& super_name, bool wip
return device->WriteFail("Unable to write new partition table");
}
fs_mgr_overlayfs_teardown();
sync();
return device->WriteOkay("Successfully updated partition table");
}