[pacman-dev] delay writes a fsync

Thomas Bächler thomas at archlinux.org
Thu Mar 12 09:24:55 EDT 2009


Thomas Bächler schrieb:
> Allan McRae schrieb:
>> A key part of the bug report comment...
>> Applications are expected to use fsync() or fdatasync(), and if that 
>> impacts their performance too much, to use a single berkdb or other 
>> binary database file, and not do something stupid with hundreds of 
>> tiny text files that only hold a few bytes of data in each text file.
> 
> It looks like this is called with the fd of an open file. What happens 
> if you call fclose()? Is it synced automatically then, or do you need to 
> run fsync() before fclose()?

Okay, I read up on it and apparently, fclose does not guarantee fsync. 
For ext4, one can probably work around that problem by mounting with the 
"nodelalloc" option, but that will result in performance penalties and 
more fragmentation.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
URL: <http://www.archlinux.org/pipermail/pacman-dev/attachments/20090312/e40b9754/attachment.pgp>


More information about the pacman-dev mailing list