Linux-Fsdevel Archive on lore.kernel.org
 help / color / Atom feed
From: "McIntyre, Vincent (CASS, Marsfield)" <Vincent.Mcintyre@csiro.au>
To: Ian Kent <raven@themaw.net>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
	autofs mailing list <autofs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/4] autofs: add comment about autofs_mountpoint_changed()
Date: Fri, 27 Mar 2020 05:19:29 +0000
Message-ID: <20200327051928.i5xtvskvktbugifa@mayhem.atnf.CSIRO.AU> (raw)
In-Reply-To: <158520021604.5325.4342529050022426912.stgit@mickey.themaw.net>

One nit, below.
Vince

On Thu, Mar 26, 2020 at 01:23:36PM +0800, Ian Kent wrote:
>The function autofs_mountpoint_changed() is unusual, add a comment
>about two cases for which it is used.
>
>Signed-off-by: Ian Kent <raven@themaw.net>
>---
> fs/autofs/root.c |   21 ++++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
>diff --git a/fs/autofs/root.c b/fs/autofs/root.c
>index 308cc49aca1d..a972bbaecb46 100644
>--- a/fs/autofs/root.c
>+++ b/fs/autofs/root.c
>@@ -280,9 +280,24 @@ static struct dentry *autofs_mountpoint_changed(struct path *path)
> 	struct dentry *dentry = path->dentry;
> 	struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb);
>
>-	/*
>-	 * If this is an indirect mount the dentry could have gone away
>-	 * as a result of an expire and a new one created.
>+	/* If this is an indirect mount the dentry could have gone away
>+	 * and a new one created.
>+	 *
>+	 * This is unusual and I can't remember the case for which it
>+	 * was originally added now. But a example of how this can

'an' example

>+	 * happen is an autofs indirect mount that has the "browse"
>+	 * option set and also has the "symlink" option in the autofs
>+	 * map entry. In this case the daemon will remove the browse
>+	 * directory and create a symlink as the mount (pointing to a
>+	 * local path) leaving the struct path stale.
>+	 *
>+	 * Another not so obvious case is when a mount in an autofs
>+	 * indirect mount that uses the "nobrowse" option is being
>+	 * expired and the mount has been umounted but the mount point
>+	 * directory remains when a stat family system call is made.
>+	 * In this case the mount point is removed (by the daemon) and
>+	 * a new mount triggered leading to a stale dentry in the struct
>+	 * path of the waiting process.
> 	 */
> 	if (autofs_type_indirect(sbi->type) && d_unhashed(dentry)) {
> 		struct dentry *parent = dentry->d_parent;
>

-- 

  reply index

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-26  5:23 [PATCH 1/4] autofs: dont call do_expire_wait() in autofs_d_manage() Ian Kent
2020-03-26  5:23 ` [PATCH 2/4] autofs: remove rcu_walk parameter from autofs_expire_wait() Ian Kent
2020-03-26  5:23 ` [PATCH 3/4] vfs: check for autofs expiring dentry in follow_automount() Ian Kent
2020-03-27  5:18   ` McIntyre, Vincent (CASS, Marsfield)
2020-03-27 11:31     ` Ian Kent
2020-03-26  5:23 ` [PATCH 4/4] autofs: add comment about autofs_mountpoint_changed() Ian Kent
2020-03-27  5:19   ` McIntyre, Vincent (CASS, Marsfield) [this message]
2020-03-27 11:33     ` Ian Kent
2020-03-30 23:06 [PATCH 1/4] autofs: dont call do_expire_wait() in autofs_d_manage() Ian Kent
2020-03-30 23:07 ` [PATCH 4/4] autofs: add comment about autofs_mountpoint_changed() Ian Kent

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=20200327051928.i5xtvskvktbugifa@mayhem.atnf.CSIRO.AU \
    --to=vincent.mcintyre@csiro.au \
    --cc=autofs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=raven@themaw.net \
    --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

Linux-Fsdevel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fsdevel/0 linux-fsdevel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fsdevel linux-fsdevel/ https://lore.kernel.org/linux-fsdevel \
		linux-fsdevel@vger.kernel.org
	public-inbox-index linux-fsdevel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fsdevel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git