From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH, RFC] add a vfs_fsync helper Date: Mon, 22 Dec 2008 13:25:47 +0000 Message-ID: <20081222132547.GJ28946@ZenIV.linux.org.uk> References: <20081222090357.GA27399@lst.de> <20081222123534.GE13406@wotan.suse.de> <20081222125622.GA3019@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Nick Piggin , 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 To: Christoph Hellwig Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:35877 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185AbYLVNZx (ORCPT ); Mon, 22 Dec 2008 08:25:53 -0500 Content-Disposition: inline In-Reply-To: <20081222125622.GA3019@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Dec 22, 2008 at 01:56:22PM +0100, Christoph Hellwig wrote: > On Mon, Dec 22, 2008 at 01:35:34PM +0100, Nick Piggin wrote: > > 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? > > At least XFS doesn't need it. Same for the filemap_fdatawrite / > filemap_fdatawait which at least for filesystems that want to provide > integrity guarantees is in the wrong place. > > This patch is a first one out my work to refactor fsync, and I'm trying > to feed it to mainline in pieces. The next one will be to make sure > nfsd always has a struct file available when calling fsync, but I need > to do some extensive benchmarking. After that we can change the > fsync prototype to drop the dentry paramters, and move the > filemap_fdatawrite / filemap_fdatawait aswell as the i_mutex locking > into the actual methods. I don't think that anything generic needs it anymore (if it ever did). That was before my time (2.1.56, so it's probably Bill Hawes) and I suspect that the reason had been along the lines of "we really don't want to think about fsync() vs. truncate() races, let's just serialize it".