They all return before the write even finishes. This is most obvious when writing over slow connections. And they do not return any errors as well... This will cause programs checking the status of their writes via eg fstat() to think their writes failed since the fstat() is done even before the file is finished uploading and you will see no file or a partially uploaded file instead.
This looks like it is probably a race condition.
If you do something like this:
open()
write()
fsync()
fstat()
close()
They all return before the write even finishes. This is most obvious when writing over slow connections. And they do not return any errors as well... This will cause programs checking the status of their writes via eg fstat() to think their writes failed since the fstat() is done even before the file is finished uploading and you will see no file or a partially uploaded file instead.