All of lore.kernel.org
 help / color / mirror / Atom feed
From: bfields@fieldses.org (J. Bruce Fields)
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 07/15] reconnect_one(): use lookup_one_len_unlocked()
Date: Mon, 18 Apr 2016 15:23:51 -0400	[thread overview]
Message-ID: <20160418192351.GC3193@fieldses.org> (raw)
In-Reply-To: <1460768127-31822-7-git-send-email-viro@ZenIV.linux.org.uk>

On Sat, Apr 16, 2016 at 01:55:19AM +0100, Al Viro wrote:
> From: Al Viro <viro@zeniv.linux.org.uk>
> 
> ... 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 <viro@zeniv.linux.org.uk>
> ---
>  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

  reply	other threads:[~2016-04-18 19:23 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-16  0:52 [PATCHSET][RFC][CFT] parallel lookups Al Viro
2016-04-16  0:55 ` [PATCH 01/15] security_d_instantiate(): move to the point prior to attaching dentry to inode Al Viro
2016-04-16  0:55 ` [PATCH 02/15] kernfs: use lookup_one_len_unlocked() Al Viro
2016-04-16  0:55 ` [PATCH 03/15] configfs_detach_prep(): make sure that wait_mutex won't go away Al Viro
2016-04-16  0:55 ` [PATCH 04/15] ocfs2: don't open-code inode_lock/inode_unlock Al Viro
2016-04-16  0:55 ` [PATCH 05/15] orangefs: " Al Viro
2016-04-16  0:55 ` [PATCH 06/15] reiserfs: open-code reiserfs_mutex_lock_safe() in reiserfs_unpack() Al Viro
2016-04-16  0:55 ` [PATCH 07/15] reconnect_one(): use lookup_one_len_unlocked() Al Viro
2016-04-18 19:23   ` J. Bruce Fields [this message]
2016-04-16  0:55 ` [PATCH 08/15] ovl_lookup_real(): " Al Viro
2016-04-16  0:55 ` [PATCH 09/15] lookup_slow(): bugger off on IS_DEADDIR() from the very beginning Al Viro
2016-04-16  0:55 ` [PATCH 10/15] __d_add(): don't drop/regain ->d_lock Al Viro
2016-04-24 18:09   ` Jeff Layton
2016-04-24 19:21     ` Al Viro
2016-04-16  0:55 ` [PATCH 11/15] beginning of transition to parallel lookups - marking in-lookup dentries Al Viro
2016-04-16  0:55 ` [PATCH 12/15] parallel lookups machinery, part 2 Al Viro
2016-04-16  0:55 ` [PATCH 13/15] parallel lookups machinery, part 3 Al Viro
2016-04-18 20:45   ` J. Bruce Fields
2016-04-16  0:55 ` [PATCH 14/15] parallel lookups machinery, part 4 (and last) Al Viro
2016-04-16  0:55 ` [PATCH 15/15] parallel lookups: actual switch to rwsem Al Viro
2016-04-16  3:02   ` Andreas Dilger
2016-04-16  3:31     ` Al Viro
2016-04-16  3:02 ` [PATCHSET][RFC][CFT] parallel lookups Andreas Dilger
2016-04-16  3:27   ` Al Viro

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=20160418192351.GC3193@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.