mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 18:25:10 +00:00
(modify and resend) 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. We sent this in CL 41269, however it is reverted because the sync() and syncfs() make test cases timeout (tons of disk access). So we only sync file itself in this CL and leave the whoe system sync outside cgpt. BUG=chromium-os:35992 TEST=make && make runtests ; and trybot BRANCH=none Change-Id: I9c6b602220131f1f011e7865788a122d4c379e73 Reviewed-on: https://gerrit.chromium.org/gerrit/41345 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Yung-Chieh Lo <yjlou@chromium.org> Tested-by: Yung-Chieh Lo <yjlou@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
committed by
ChromeBot
parent
96d16de52e
commit
57cdad33d6
@@ -269,6 +269,11 @@ int DriveClose(struct drive *drive, int update_as_needed) {
|
||||
}
|
||||
}
|
||||
|
||||
// Sync early! Only sync file descriptor here, and leave the whole system sync
|
||||
// outside cgpt because whole system sync would trigger tons of disk accesses
|
||||
// and timeout tests.
|
||||
fsync(drive->fd);
|
||||
|
||||
close(drive->fd);
|
||||
|
||||
if (drive->gpt.primary_header)
|
||||
|
||||
Reference in New Issue
Block a user