linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Christoph Hellwig <hch@lst.de>
Cc: viro@zeniv.linux.org.uk, dbrownell@users.sourceforge.net,
	agl@us.ibm.com, ebiederm@xmission.com,
	linux-fsdevel@vger.kernel.org,
	ecryptfs-devel@lists.launchpad.net, jaharkes@cs.cmu.edu
Subject: Re: [PATCH, RFC] add a vfs_fsync helper
Date: Mon, 22 Dec 2008 13:35:34 +0100	[thread overview]
Message-ID: <20081222123534.GE13406@wotan.suse.de> (raw)
In-Reply-To: <20081222090357.GA27399@lst.de>

On Mon, Dec 22, 2008 at 10:03:57AM +0100, Christoph Hellwig wrote:
> Fsync currently has a fdatawrite/fdatawait pair around the method call,
> and a mutex_lock/unlock of the inode mutex.  All callers of fsync have
> to duplicate this, but we have a few and most of them don't quite get
> it right.  This patch adds a new vfs_fsync that takes care of this.
> It's a little more complicated as usual as ->fsync might get a NULL file
> pointer and just a dentry from nfsd, but otherwise gets afile and we
> want to take the mapping and file operations from it when it is there.
> 
> Notes on the fsync callers:
> 
>  - ecryptfs wasn't calling filemap_fdatawrite / filemap_fdatawait on the
>    	lower file
>  - coda wasn't calling filemap_fdatawrite / filemap_fdatawait on the host
> 	file, and returning 0 when ->fsync was missing
>  - shm wasn't calling either filemap_fdatawrite / filemap_fdatawait nor
>    taking i_mutex.  Now given that shared memory doesn't have disk
>    backing not doing anything in fsync seems fine and I left it out of
>    the vfs_fsync conversion for now, but in that case we might just
>    not pass it through to the lower file at all but just call the no-op
>    simple_sync_file directly.

Seems like an improvement.. I've wanted to know, though, what do
we need i_mutex for? Is it just convention, or is there some good
reason to have it in generic code?

  reply	other threads:[~2008-12-22 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22  9:03 [PATCH, RFC] add a vfs_fsync helper Christoph Hellwig
2008-12-22 12:35 ` Nick Piggin [this message]
2008-12-22 12:56   ` Christoph Hellwig
2008-12-22 13:00     ` Nick Piggin
2008-12-22 13:25     ` Al Viro
2008-12-22 20:11 ` [PATCH] " Christoph Hellwig
2008-12-22 20:42   ` David Brownell

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=20081222123534.GE13406@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=agl@us.ibm.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=ebiederm@xmission.com \
    --cc=ecryptfs-devel@lists.launchpad.net \
    --cc=hch@lst.de \
    --cc=jaharkes@cs.cmu.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).