[PATCH] ldconfig: Call fsync on temporary files before renaming them [BZ #20890]

Florian Weimer fweimer@redhat.com
Fri Jan 12 11:54:00 GMT 2018


On 01/12/2018 12:37 PM, Christoph Hellwig wrote:
> On Fri, Jan 12, 2018 at 12:07:57PM +0100, Florian Weimer wrote:
>> If the system crashes before the file data has been written to disk, the
>> file system recovery upon the next mount may restore a partially
>> rewritten temporary file under the non-temporary (final) name (after the
>> rename operation).
>>
>> Some file systems perform an implicit fsync before renaming a file over
>> another one, but XFS does not, for example.
> 
> At least on Linux no file system performs an actual fsync equivalent.
> A few do start a writeout, but don't actually wait on it.

Oh.  I'll drop the last paragraph from the commit message, then.

Thanks,
Florian



More information about the Libc-alpha mailing list