Ts'o: Delayed allocation and the zero-length file problem
Ts'o: Delayed allocation and the zero-length file problem
Posted Mar 14, 2009 8:15 UTC (Sat) by alexl (guest, #19068)In reply to: Ts'o: Delayed allocation and the zero-length file problem by drag
Parent article: Ts'o: Delayed allocation and the zero-length file problem
The rename is documented by posix and unix since forever to be atomic. That is not some form of "workaround", or "compensation" but a solid safe, well documented way to write files. However, those atomicity guarantees are only valid if the system doesn't crash (as crashes are not specified by posix).
The "atomic" part is protection against other apps that are saving to the file at the same time, not crashes. The fsync is only required not to get problems when the system crashes.
