Comment 157 for bug 317781

Revision history for this message
Michel Lind (michel-slm) wrote :

@Olaf

from the manpage, fsync() transfers "all modified in-core data of the file referred to by the file descriptor fd". So it should really be all pending writes, not just the writes that take place using the current fd.

I cannot really reboot any of my machines right now, but it does make sense. This use case:

1. program A writes a file, closes it without fsync
2. program B writes to the same file, fsyncs, closes

Program B should rightly expect to have the file to have the same on-disk content as its view of the file at the time it fsync(), which means any prior non-committed parts of the file that B sees should also be committed, modulo B's changes.