(cherry-pick for R25)(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.

TEST=make && make runtests ; and trybot

Original-Change-Id: I9c6b602220131f1f011e7865788a122d4c379e73
(cherry picked from commit 8e9b61a8f9e0d1446a2ac98db1959ed561880d91)

Change-Id: I5f419332cc5887d734f507533927e049e6cfbbf0
Reviewed-on: https://gerrit.chromium.org/gerrit/42211
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
Commit-Queue: Yung-Chieh Lo <yjlou@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou@chromium.org>
1 file changed