aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Kent <raven@themaw.net>2017-11-29 19:11:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-29 21:40:43 -0500
commit43694d4bf843ddd34519e8e9de983deefeada699 (patch)
treedca9964a3f55959a461860ff8bdcee5c9d4b3034
parentb6e8e12c0aeb5fbf1bf46c84d58cc93aedede385 (diff)
autofs: revert "autofs: take more care to not update last_used on path walk"
While commit 092a53452bb7 ("autofs: take more care to not update last_used on path walk") 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. Link: http://lkml.kernel.org/r/151174729420.6162.1832622523537052460.stgit@pluto.themaw.net Fixes: 092a53452b ("autofs: take more care to not update last_used on path walk") Signed-off-by: Ian Kent <raven@themaw.net> Reviewed-by: NeilBrown <neilb@suse.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: <stable@vger.kernel.org> [4.11+] Cc: Colin Walters <walters@redhat.com> Cc: David Howells <dhowells@redhat.com> Cc: Ondrej Holy <oholy@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/autofs4/root.c17
1 files 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)
281 pr_debug("waiting for mount name=%pd\n", path->dentry); 281 pr_debug("waiting for mount name=%pd\n", path->dentry);
282 status = autofs4_wait(sbi, path, NFY_MOUNT); 282 status = autofs4_wait(sbi, path, NFY_MOUNT);
283 pr_debug("mount wait done status=%d\n", status); 283 pr_debug("mount wait done status=%d\n", status);
284 ino->last_used = jiffies;
285 } 284 }
285 ino->last_used = jiffies;
286 return status; 286 return status;
287} 287}
288 288
@@ -321,21 +321,16 @@ static struct dentry *autofs4_mountpoint_changed(struct path *path)
321 */ 321 */
322 if (autofs_type_indirect(sbi->type) && d_unhashed(dentry)) { 322 if (autofs_type_indirect(sbi->type) && d_unhashed(dentry)) {
323 struct dentry *parent = dentry->d_parent; 323 struct dentry *parent = dentry->d_parent;
324 struct autofs_info *ino;
324 struct dentry *new; 325 struct dentry *new;
325 326
326 new = d_lookup(parent, &dentry->d_name); 327 new = d_lookup(parent, &dentry->d_name);
327 if (!new) 328 if (!new)
328 return NULL; 329 return NULL;
329 if (new == dentry) 330 ino = autofs4_dentry_ino(new);
330 dput(new); 331 ino->last_used = jiffies;
331 else { 332 dput(path->dentry);
332 struct autofs_info *ino; 333 path->dentry = new;
333
334 ino = autofs4_dentry_ino(new);
335 ino->last_used = jiffies;
336 dput(path->dentry);
337 path->dentry = new;
338 }
339 } 334 }
340 return path->dentry; 335 return path->dentry;
341} 336}