[rsyslog] ultra-reliable disk files fsync vs. fdatasync
david at lang.hm
david at lang.hm
Mon Jun 8 18:09:56 CEST 2009
On Mon, 8 Jun 2009, Rainer Gerhards wrote:
> Hi all,
>
> I am working on the ultra-reliable file writing capability. I have revisited
> the doc and am considering fsync() vs. fdatasync(). From the man pages, it
> looks like fdatasync() is sufficient if I just need to ensure that any data
> written can also be read. The advantage of fdatasync() is that it is somewhat
> faster as not all meta data is necessarily written.
>
> I would appreciate if someone could comment on this issue.
my understanding is that if you are growing the file you need to do a
fsync of the directory, but if you are re-writing part of an already
allocated file fdatasync is the better thing to use.
David Lang
More information about the rsyslog
mailing list