mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Trigger sync right after writing.
This can trigger the sync mechanism earlier so that the kernel has enough time to schedule a real disk sync before system reboots. BUG=chromium-os:35992 TEST=compile only BRANCH=none Change-Id: I505fdf45d95a52c9eca7687ecd6fb9f6be8cc5f1 Reviewed-on: https://gerrit.chromium.org/gerrit/41269 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Yung-Chieh Lo <yjlou@chromium.org> Commit-Queue: Yung-Chieh Lo <yjlou@chromium.org>
This commit is contained in:
committed by
ChromeBot
parent
826db09fce
commit
f3613b60c7
@@ -269,7 +269,12 @@ int DriveClose(struct drive *drive, int update_as_needed) {
|
||||
}
|
||||
}
|
||||
|
||||
// Sync early!
|
||||
fsync(drive->fd);
|
||||
syncfs(drive->fd);
|
||||
|
||||
close(drive->fd);
|
||||
sync();
|
||||
|
||||
if (drive->gpt.primary_header)
|
||||
free(drive->gpt.primary_header);
|
||||
|
||||
Reference in New Issue
Block a user