linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/3] NFS: Fix up the fsync code
Date: Wed, 14 Jul 2010 09:17:23 -0400	[thread overview]
Message-ID: <1279113443.3103.10.camel@heimdal.trondhjem.org> (raw)
In-Reply-To: <20100714070008.GA22884@infradead.org>

On Wed, 2010-07-14 at 03:00 -0400, Christoph Hellwig wrote:
> On Tue, Jul 13, 2010 at 03:50:36PM -0400, Trond Myklebust wrote:
> > NFS can't distinguish between a datasync and a full sync: a successful
> > COMMIT operation guarantees that both data+metadata updates are on disk.
> > For this reason we ignore the 'datasync' parameter in our fsync
> > implementation.
> 
> That's not what the datasync parameter means.
> 
> Both fsync and fdatasync will commit data and metadata to disk, the
> questions is how much metadata we need to commit.  For fdatasync it's
> only the metadata requires to locate the file data on disk, an
> fsync requires everything (which is the above + timestamps basically).
> 
> I suspect for NFS the difference still doesn't matter, I'd just try
> to make it clear.

Right. My point was that in NFSv3 and NFSv4, COMMIT always acts like
fsync(): it commits data + _all_ metadata (i.e. including size
+timestamps) to disk.

The exception is NFSv4.1 with pNFS, where you have an extra
'LAYOUTCOMMIT' operation that tells the metadata server when to write
the size+timestamps (because the WRITE and COMMIT operations are sent to
the data servers). So we might want to distinguish between fsync() and
fdatasync() when we merge that code.

> > Would it perhaps help if I added a comment to that effect in
> > nfs_file_fsync() itself?
> 
> Yes, comments explaining such higher level concepts are always good.

OK. I'll add something to that effect.

Thanks for the review!

  Trond

  reply	other threads:[~2010-07-14 13:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-12 22:09 [PATCH 1/3] NFS: Fix up the fsync code Trond Myklebust
2010-07-12 22:09 ` [PATCH 2/3] NFS: Clean up the callers of nfs_wb_all() Trond Myklebust
2010-07-12 22:09 ` [PATCH 3/3] NFS: nfs_rename() should not have to flush out writebacks Trond Myklebust
2010-07-13  1:13 ` [PATCH 1/3] NFS: Fix up the fsync code Christoph Hellwig
2010-07-13 19:50   ` Trond Myklebust
2010-07-14  7:00     ` Christoph Hellwig
2010-07-14 13:17       ` Trond Myklebust [this message]
2010-08-13  8:39 ` Christoph Hellwig

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=1279113443.3103.10.camel@heimdal.trondhjem.org \
    --to=trond.myklebust@netapp.com \
    --cc=hch@infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    /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).