linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <trond.myklebust@fys.uio.no>
To: Christoph Hellwig <hch@infradead.org>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Moazam Raja <moazam@gmail.com>,
	linux-nfs@vger.kernel.org
Subject: Re: O_DIRECT, O_SYNC, or fsync() on NFS mounts?
Date: Sun, 21 Nov 2010 15:01:55 -0500	[thread overview]
Message-ID: <1290369715.5481.26.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20101121104624.GA13874@infradead.org>

On Sun, 2010-11-21 at 05:46 -0500, Christoph Hellwig wrote:
> On Fri, Nov 19, 2010 at 04:26:35PM -0500, Trond Myklebust wrote:
> > If the application requests O_DIRECT/O_SYNC or calls fsync(), we are
> > required by POSIX to ensure the data is safe on disk. The presence of an
> > NFS delegation does not change that requirement.
> 
> That's not quite correct.  O_DIRECT for one is not actually specific in
> Posix at all, and the documented Linux semantics only say that the
> pagecache should not be used (even if it sometimes is with various
> filesystems).  There is not guarantee that data actually is on disk or
> reachable, for that you need to add the O_SYNC/O_DYSNC flag in addition
> or use fsync/fdatasync.

True.

We treat the O_DIRECT case as being the same as O_DIRECT|O_SYNC because
we don't currently have a way to locate and track outstanding O_DIRECT
rpc calls, and so fsync() has no effect.

We do, however support aio/dio, and so people who want better writev()
syscall latency can use that...

Cheers
  Trond


  parent reply	other threads:[~2010-11-21 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 23:34 O_DIRECT, O_SYNC, or fsync() on NFS mounts? Moazam Raja
2010-11-19 19:24 ` Trond Myklebust
2010-11-19 19:55   ` Chuck Lever
2010-11-19 20:04   ` J. Bruce Fields
2010-11-19 21:26     ` Trond Myklebust
2010-11-19 21:48       ` J. Bruce Fields
2010-11-21 10:46       ` Christoph Hellwig
2010-11-21 19:31         ` Moazam Raja
2010-11-21 20:01         ` Trond Myklebust [this message]
     [not found]   ` <AANLkTi=AV20AsUKOGfVg6M92T8LfPLuuyrG_hQESw_RU@mail.gmail.com>
2010-11-20 23:54     ` Trond Myklebust
     [not found]       ` <AANLkTikFfdMWs0b4V1doVYUx1T96+ef8-dMUZf3v8cW9@mail.gmail.com>
2010-11-22 18:04         ` Trond Myklebust

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=1290369715.5481.26.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@fys.uio.no \
    --cc=bfields@fieldses.org \
    --cc=hch@infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=moazam@gmail.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;
as well as URLs for NNTP newsgroup(s).