From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:39708 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932486AbeENP0M (ORCPT ); Mon, 14 May 2018 11:26:12 -0400 Date: Mon, 14 May 2018 16:26:11 +0100 From: Al Viro To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 05/15] freevxfs_lookup(): use d_splice_alias() Message-ID: <20180514152611.GF30522@ZenIV.linux.org.uk> References: <20180513212612.GV30522@ZenIV.linux.org.uk> <20180513213017.31269-1-viro@ZenIV.linux.org.uk> <20180513213017.31269-5-viro@ZenIV.linux.org.uk> <20180514084102.GA21222@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180514084102.GA21222@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, May 14, 2018 at 10:41:02AM +0200, Christoph Hellwig wrote: > On Sun, May 13, 2018 at 10:30:07PM +0100, Al Viro wrote: > > From: Al Viro > > > > Cc: Christoph Hellwig > > Signed-off-by: Al Viro > > It looks a little cleaner, so this is fine, but is there also any > other reason? A little changelog would be nice. The same changelog would be duplicated in a bunch of commits in that series and I'm not sure how much is too much. Let me put it that way: * d_splice_alias() has better calling conventions for use in ->lookup() - it tends to reduce the number of branches nicely. * d_add() in ->lookup() is no-go for anything exportable; we did conversion for exported stuff back then, and it's documented in Documentation/filesystems/nfs/Exporting, but people fail to RTFM when converting more filesystems to exportability. Preempting that kind of bugs is a good idea. * the fewer stray d_add() we have sitting around, the better - each needs a proof that this particular invocation won't end up with multiple aliases of a directory inode. d_splice_alias() is *NOT* a universal replacement, but in a lot of ->lookup() instances we can use it sanely; it can't be done quite blindly (the stuff that hangs something off the dentry needs a careful look), but most of the time it's fine - on any filesystem that doesn't play with ->d_fsdata, for starters. And in all cases such replacement in ->lookup() is "it's no worse than before" - it's just that some cases need more than just that conversion before they can be made exportable (see e.g. 9p for example of that kind of extra work; res = d_splice_alias(inode, dentry); if (!res) v9fs_fid_add(dentry, fid); else if (!IS_ERR(res)) v9fs_fid_add(res, fid); else p9_client_clunk(fid); in there, when we need to decide which dentry to slap the fid onto) The bunch in this series is the trivial part of conversions. Next group is where a bit more attention is needed and the last is procfs nest of horrors. I'm honestly not sure how much of the above makes sense as a boilerplate to go into all those commits. Suggestions?