Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751986AbcDRTXy (ORCPT ); Mon, 18 Apr 2016 15:23:54 -0400 Received: from fieldses.org ([173.255.197.46]:44214 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbcDRTXw (ORCPT ); Mon, 18 Apr 2016 15:23:52 -0400 Date: Mon, 18 Apr 2016 15:23:51 -0400 To: Al Viro Cc: Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 07/15] reconnect_one(): use lookup_one_len_unlocked() Message-ID: <20160418192351.GC3193@fieldses.org> References: <20160416005232.GV25498@ZenIV.linux.org.uk> <1460768127-31822-7-git-send-email-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460768127-31822-7-git-send-email-viro@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1987 Lines: 59 On Sat, Apr 16, 2016 at 01:55:19AM +0100, Al Viro wrote: > From: Al Viro > > ... and explain the non-obvious logics in case when lookup yields > a different dentry. ACK to this independent of the rest of the series, my only minor gripe is that the point made in this new comment is also made at out_reconnected: and at the head of reconnect_one(). And would also apply at the other "goto out_reconnected". My preference is to leave things as they are, but if you found it easy to overlook maybe just something like: - goto out_reconnected; + goto out_reconnected; /* see comment there*/ would be helpful. And/or improving the final comment. --b. > > Signed-off-by: Al Viro > --- > fs/exportfs/expfs.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c > index c46f1a1..402c5ca 100644 > --- a/fs/exportfs/expfs.c > +++ b/fs/exportfs/expfs.c > @@ -143,14 +143,18 @@ static struct dentry *reconnect_one(struct vfsmount *mnt, > if (err) > goto out_err; > dprintk("%s: found name: %s\n", __func__, nbuf); > - inode_lock(parent->d_inode); > - tmp = lookup_one_len(nbuf, parent, strlen(nbuf)); > - inode_unlock(parent->d_inode); > + tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf)); > if (IS_ERR(tmp)) { > dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp)); > goto out_err; > } > if (tmp != dentry) { > + /* > + * Somebody has renamed it since exportfs_get_name(); > + * great, since it could've only been renamed if it > + * got looked up and thus connected, and it would > + * remain connected afterwards. We are done. > + */ > dput(tmp); > goto out_reconnected; > } > -- > 2.8.0.rc3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html