linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: Ian Kent <raven@themaw.net>, Andrew Morton <akpm@linux-foundation.org>
Cc: Colin Walters <walters@redhat.com>,
	Ondrej Holy <oholy@redhat.com>,
	autofs mailing list <autofs@vger.kernel.org>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Howells <dhowells@redhat.com>,
	Al Viro <viro@ZenIV.linux.org.uk>
Subject: Re: [PATCH 1/2] autofs: revert take more care to not update last_used on path walk
Date: Wed, 29 Nov 2017 09:48:09 +1100	[thread overview]
Message-ID: <87d142xbo6.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <151174729420.6162.1832622523537052460.stgit@pluto.themaw.net>

[-- Attachment #1: Type: text/plain, Size: 2562 bytes --]

On Mon, Nov 27 2017, Ian Kent wrote:

> While the patch of commit 092a53452b helped (partially) resolve a
> problem where automounts were not expiring due to aggressive accesses
> from user space it has a side effect for very large environments.
>
> This change helps with the expire problem by making the expire more
> aggressive but, for very large environments, that means more mount
> requests from clients. When there are a lot of clients that can mean
> fairly significant server load increases.
>
> It turns out I put the last_used in this position to solve this
> very problem and failed to update my own thinking of the autofs
> expire policy. So the patch being reverted introduces a regression
> which should be fixed.
>
> Reverts: 092a53452b

I would add:
 Fixes: 092a53452bb7 ("autofs: take more care to not update last_used on path walk")
 Cc: stable@vger.kernel.org (v4.11+)

to ensure these are picked up as needed (different Fixes line for second
of course).

Reviewed-by: NeilBrown <neilb@suse.com>

Thanks,
NeilBrown

>
> Signed-off-by: Ian Kent <raven@themaw.net>
> Cc: Neil Brown <neilb@suse.com>
> Cc: Al Viro <viro@ZenIV.linux.org.uk>
> ---
>  fs/autofs4/root.c |   17 ++++++-----------
>  1 file changed, 6 insertions(+), 11 deletions(-)
>
> diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
> index d79ced925861..82e8f6edfb48 100644
> --- a/fs/autofs4/root.c
> +++ b/fs/autofs4/root.c
> @@ -281,8 +281,8 @@ static int autofs4_mount_wait(const struct path *path, bool rcu_walk)
>  		pr_debug("waiting for mount name=%pd\n", path->dentry);
>  		status = autofs4_wait(sbi, path, NFY_MOUNT);
>  		pr_debug("mount wait done status=%d\n", status);
> -		ino->last_used = jiffies;
>  	}
> +	ino->last_used = jiffies;
>  	return status;
>  }
>  
> @@ -321,21 +321,16 @@ static struct dentry *autofs4_mountpoint_changed(struct path *path)
>  	 */
>  	if (autofs_type_indirect(sbi->type) && d_unhashed(dentry)) {
>  		struct dentry *parent = dentry->d_parent;
> +		struct autofs_info *ino;
>  		struct dentry *new;
>  
>  		new = d_lookup(parent, &dentry->d_name);
>  		if (!new)
>  			return NULL;
> -		if (new == dentry)
> -			dput(new);
> -		else {
> -			struct autofs_info *ino;
> -
> -			ino = autofs4_dentry_ino(new);
> -			ino->last_used = jiffies;
> -			dput(path->dentry);
> -			path->dentry = new;
> -		}
> +		ino = autofs4_dentry_ino(new);
> +		ino->last_used = jiffies;
> +		dput(path->dentry);
> +		path->dentry = new;
>  	}
>  	return path->dentry;
>  }

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      parent reply	other threads:[~2017-11-28 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27  1:48 [PATCH 1/2] autofs: revert take more care to not update last_used on path walk Ian Kent
2017-11-27  1:48 ` [PATCH 2/2] autofs: revert fix AT_NO_AUTOMOUNT not being honored Ian Kent
2017-11-28 22:48 ` NeilBrown [this message]

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=87d142xbo6.fsf@notabene.neil.brown.name \
    --to=neilb@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=autofs@vger.kernel.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oholy@redhat.com \
    --cc=raven@themaw.net \
    --cc=viro@ZenIV.linux.org.uk \
    --cc=walters@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).