2 ms·
This has nothing to do with fsync(). If you lseek() back to the beginning after each write(), this behavior should never occur. Growing a file is complicated,
by geocar 17y ago
This has nothing to do with fsync().
If you lseek() back to the beginning after each write(), this behavior should never occur.
Growing a file is complicated, and may require extra unexpected disk accesses while the directory entry is modified or the free blocks are reassigned. These are what are blocking the write(), and write() will do them eventually, on a busy enough system, whether you call fsync() or not.