Re: Why O_SYNC is faster than fsync on ext3

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yusuf Goolamabbas <yusufg@outblaze.com>
Cc: pgsql-hackers@postgresql.org
Date: 2004-03-21T16:10:32Z
Lists: pgsql-hackers
Yusuf Goolamabbas <yusufg@outblaze.com> writes:
> Bruce, haven't followed the thread completely. Accessing the web archive
> is slow from Hong Kong but I just wanted to point you to this lkml post
> which shows why O_SYNC is much faster than fsync (at least on ext3)
> http://marc.theaimsgroup.com/?l=linux-kernel&m=107959907410443&w=2

That patch is broken on its face.  If O_SYNC doesn't take longer than
O_DSYNC, and likewise fsync longer than fdatasync, then the Unix
filesystem semantics are not being honored because the file mod time
isn't being updated.

			regards, tom lane