On Sat, 6 Mar 2010, Guillem Jover <[email protected]> wrote:
>     This guarantees the file contents will be there in case of abrupt
>     program termination (due to crashes for example, or user intervention).
>     This also guarantees the atomicity of rename(2) calls.

This description is incorrect.

fsync() has no bearing on what will happen if the program crashes.  If a 
program crashes immediately after a write() system call has succeeded then 
the kernel will take care of flushing the cache to disk afterwards.

fsync() is used specifically to deal with the case of abrupt OS termination 
due to a kernel crash or hardware failure.  The only user intervention which 
is relevant is that which involves the reset button, the power switch, 
or "shutdown -nf".  This is particularly difficult in the case of a cluster 
where a "reboot -nf" or IPMI reboot is a rare but normal part of the 
operation of the system.




--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to