public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: bpm@sgi.com
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [RFC PATCH 4/4] If 'wsync' pass datasync=1 to vfs_fsync().
Date: Thu, 4 Feb 2010 11:20:16 -0600	[thread overview]
Message-ID: <20100204172016.GJ5702@sgi.com> (raw)
In-Reply-To: <20100204151926.GA22014@infradead.org>

On Thu, Feb 04, 2010 at 10:19:26AM -0500, Christoph Hellwig wrote:
> On Wed, Feb 03, 2010 at 05:44:44PM -0600, Ben Myers wrote:
> > 
> > ---
> >  fs/nfsd/vfs.c |   39 +++++++++++++++++++++++++--------------
> >  1 files changed, 25 insertions(+), 14 deletions(-)
> > 
> > diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
> > index 89eb1b2..4b1973b 100644
> > --- a/fs/nfsd/vfs.c
> > +++ b/fs/nfsd/vfs.c
> > @@ -418,7 +418,7 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,
> >  	if (!err) {
> >  		if (EX_ISSYNC(fhp->fh_export)) {
> >  			if (EX_ISWSYNC(fhp->fh_export)) {
> > -				vfs_fsync(NULL, dentry, 0);
> > +				vfs_fsync(NULL, dentry, 1);
> 
> I think this is incorrect.  datasync = 1 means to only write out
> metadata that is required to access the file data.

My thinking there was that the XFS wsync mount option would have ensured
that the metadata that changed is already in the log.  I wonder if when
using the wsync xfs mount option, could one drop the vfs_fsync
altogether?  Looks to me like O_SYNC would also have taken care of any
metadata that is required to access the file data.

> The write_inode code
> makes sure all metadata goes out, which AFAIK is what the NFS protocol
> requires from us anyway for all these metadata operations.

I think only the data/metadata that changed for the rpc in question
needs to end up on stable storage.

> Note that this does not invalidate your XFS numbers as right now XFS
> doesn't actually implement the datasync == 1 optimization, although I'm
> about to send a patch to do that.  The updsize is that this will
> make your patchset quite a bit simpler :)

Cool.  ;)

-Ben

  reply	other threads:[~2010-02-04 17:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 23:44 [RFC PATCH 0/4] wsync export option Ben Myers
2010-02-03 23:44 ` [RFC PATCH 1/4] Add 'wsync' " Ben Myers
2010-02-03 23:44 ` [RFC PATCH 2/4] Add datasync argument to nfsd_sync_dir() Ben Myers
2010-02-03 23:44 ` [RFC PATCH 3/4] If 'wsync' call vfs_fsync() instead of write_inode_now() Ben Myers
2010-02-03 23:44 ` [RFC PATCH 4/4] If 'wsync' pass datasync=1 to vfs_fsync() Ben Myers
2010-02-04 15:19   ` Christoph Hellwig
2010-02-04 17:20     ` bpm [this message]
2010-02-04 18:30       ` Christoph Hellwig
2010-02-04 18:38         ` Trond Myklebust
2010-02-04 18:40           ` Christoph Hellwig
2010-02-04 18:52             ` Trond Myklebust
2010-02-03 23:47 ` [ RFC PATCH 5/4 ] Add wsync export option to nfs-utils bpm
2010-02-03 23:58 ` [RFC PATCH 0/4] wsync export option Trond Myklebust
2010-02-04 15:21   ` Christoph Hellwig
2010-02-04 15:30 ` Christoph Hellwig
2010-02-04 18:15   ` bpm
2010-02-04 18: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=20100204172016.GJ5702@sgi.com \
    --to=bpm@sgi.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