public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Tom Vier <thomassr@erols.com>
Cc: Denis Perchine <dyp@perchine.com>,
	linux-kernel@vger.kernel.org, Stephen Tweedie <sct@redhat.com>
Subject: Re: O_DSYNC flag for open
Date: Fri, 16 Mar 2001 12:11:47 +0000	[thread overview]
Message-ID: <20010316121147.B1771@redhat.com> (raw)
In-Reply-To: <01031013035702.00608@dyp.perchine.com> <20010314222642.A19634@zero>
In-Reply-To: <20010314222642.A19634@zero>; from thomassr@erols.com on Wed, Mar 14, 2001 at 10:26:42PM -0500

Hi,

On Wed, Mar 14, 2001 at 10:26:42PM -0500, Tom Vier wrote:
> fdatasync() is the same as fsync(), in linux.

No, in 2.4 fdatasync does the right thing and skips the inode flush if
only the timestamps have changed.

> until fdatasync() is
> implimented (ie, syncs the data only)

fdatasync is required to sync more than just the data: it has to sync
the inode too if any fields other than the timestamps have changed.
So, for appending to files or writing new files from scratch, fsync ==
fdatasync (because each write also changes the inode size).  Only for
updating existing files in place does fdatasync behave differently.

> #ifndef O_DSYNC
> # define O_DSYNC O_SYNC
> #endif

2.4's O_SYNC actually does a fdatasync internally.  This is also the
default behaviour of HPUX, which requires you to set a sysctl variable
if you want O_SYNC to flush timestamp changes to disk.

Cheers,
 Stephen

      reply	other threads:[~2001-03-16 12:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-10  7:03 O_DSYNC flag for open Denis Perchine
2001-03-15  3:26 ` Tom Vier
2001-03-16 12:11   ` Stephen C. Tweedie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010316121147.B1771@redhat.com \
    --to=sct@redhat.com \
    --cc=dyp@perchine.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomassr@erols.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox