From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752392AbdK0B6C (ORCPT ); Sun, 26 Nov 2017 20:58:02 -0500 Received: from icp-osb-irony-out6.external.iinet.net.au ([203.59.1.106]:62432 "EHLO icp-osb-irony-out6.external.iinet.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752362AbdK0B6A (ORCPT ); Sun, 26 Nov 2017 20:58:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2BwBgDkbRta/3jh/dxbHAEBAQQBAQoBA?= =?us-ascii?q?YM8gVQng3+ZNUABAQEBAQEGgQs6hWqTAB2FKIRgQxQBAQEBAQEBAQFrKIVJBFI?= =?us-ascii?q?oAQwCGA4CSRYTihUMplOBbTohAopZMoEPgiuCB4EOgjA0h32DK4JjBYowB4c/g?= =?us-ascii?q?RNfjl6VDIIWigaHMkiJb409NiKBUEwuCoJiggIBgl80NooYAQEB?= X-IPAS-Result: =?us-ascii?q?A2BwBgDkbRta/3jh/dxbHAEBAQQBAQoBAYM8gVQng3+ZNUA?= =?us-ascii?q?BAQEBAQEGgQs6hWqTAB2FKIRgQxQBAQEBAQEBAQFrKIVJBFIoAQwCGA4CSRYTi?= =?us-ascii?q?hUMplOBbTohAopZMoEPgiuCB4EOgjA0h32DK4JjBYowB4c/gRNfjl6VDIIWiga?= =?us-ascii?q?HMkiJb409NiKBUEwuCoJiggIBgl80NooYAQEB?= X-IronPort-AV: E=Sophos;i="5.44,462,1505750400"; d="scan'208";a="22866806" Subject: [PATCH 1/2] autofs: revert take more care to not update last_used on path walk From: Ian Kent To: Andrew Morton Cc: Colin Walters , Ondrej Holy , autofs mailing list , NeilBrown , Kernel Mailing List , David Howells , Al Viro Date: Mon, 27 Nov 2017 09:48:14 +0800 Message-ID: <151174729420.6162.1832622523537052460.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Ian Kent Cc: Neil Brown Cc: Al Viro --- 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; }