trusty: rpmb_dev: Prevent desync between rpmb_dev and storageproxyd

The mock RPMB can get out of sync with TD storage blocks in the event of
panic or crash. Making this O_SYNC will prevent this from happening.

Bug: 160723681
Test: None
Change-Id: Ia16dfc88ceae56e4e9724a42ac0db492c0e707a4
This commit is contained in:
Matthew Maurer 2020-07-10 13:50:32 -07:00
parent 4d3c284605
commit 8f62566566

View file

@ -591,7 +591,7 @@ int main(int argc, char** argv) {
return EXIT_SUCCESS;
}
open_flags = O_RDWR;
open_flags = O_RDWR | O_SYNC;
if (init) {
open_flags |= O_CREAT | O_TRUNC;
}