This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: aio_fsync() a directory ?


(3/12/13 5:01 AM), Xavier Roche wrote:
> Hi folks!
> 
> As a followup to a discussion 
> (<https://groups.google.com/forum/?fromgroups#!topic/comp.unix.programmer/AM2V83RCOVE>) 
> regarding synchronization of file operations (file creation, renaming, 
> symlink, etc.), it seems that the only way to "commit" a filename change 
> is to open() the containing directory in O_RDONLY, and fsync() the given 
> file descriptor.

This is right from POSIX POV.
However, at least, ext4 and btrfs have a guarantee to commit when renaming.
Because kernel developers know that many application developers don't use fsync().
See below blog post and related discussions.

http://www.redditmirror.cc/cache/websites/thunk.org_846ih/thunk.org/tytso/blog/2009/03/12/delayed-allocation-and-the-zero-length-file-problem/index.html


Sorry for the offtopic.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]