From patchwork Mon Jan 30 10:21:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Kent X-Patchwork-Id: 9544717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 13E6E60425 for ; Mon, 30 Jan 2017 10:25:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04AB926E82 for ; Mon, 30 Jan 2017 10:25:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED8CA28112; Mon, 30 Jan 2017 10:25:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63EF626E82 for ; Mon, 30 Jan 2017 10:25:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752552AbdA3KYQ (ORCPT ); Mon, 30 Jan 2017 05:24:16 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56905 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751592AbdA3KXP (ORCPT ); Mon, 30 Jan 2017 05:23:15 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 3C32520930; Mon, 30 Jan 2017 05:21:14 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 30 Jan 2017 05:21:14 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=themaw.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=6UTtRq3NE2OxuMo EGJSjy8HA0tk=; b=SE9my/XouOA4Y0fH1oQJ5CsyJrfxCT5GhGxo10qCDNQebx9 R1SxYFkrWVLu0uPvbAbuMoiVJkj4xgIsbgxCdy0C6EsEwneEloDAaEDU4ZAHgv7g jBqtUyPITR+s2hNOuxtUtQEMwg/1tAkZv/f6sNAVljARX6qv3TLFum+GdoUU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=6UTtRq3NE2OxuMoEGJSjy8HA0tk=; b=MIVHCzC5Oj5D0BtnOtN3 88ZyichYoTsQTrnJyrlm0SheRQoZ2JWOzvMv8FXfXVRNGLc5ln5MdtQqOhpVz4Xe PQ2KiUiNSP1IrTO0bigsXVB55EI/1l8mYm2Me5gsUrxb05rCY2p2er3F1kdx5Lgo 8xrNi3p7Z04nFsPUmclX8Sg= X-ME-Sender: X-Sasl-enc: xzFcyW5Ri5fRQcxC3xCZNyTDzFejpnodgQGCi+5tk5Ds 1485771673 Received: from pluto.themaw.net (124-148-64-59.dyn.iinet.net.au [124.148.64.59]) by mail.messagingengine.com (Postfix) with ESMTPA id AFF857E752; Mon, 30 Jan 2017 05:21:13 -0500 (EST) Received: from pluto.themaw.net (localhost [127.0.0.1]) by pluto.themaw.net (Postfix) with ESMTP id BBC12A08EC; Mon, 30 Jan 2017 18:21:11 +0800 (AWST) Subject: [PATCH 7/7] autofs - take more care to not update last_used on path walk From: Ian Kent To: Andrew Morton Cc: linux-fsdevel , Tomohiro Kusumi , autofs mailing list , Kernel Mailing List Date: Mon, 30 Jan 2017 18:21:11 +0800 Message-ID: <148577167169.9801.1377050092212016834.stgit@pluto.themaw.net> In-Reply-To: <148577164094.9801.4775075118014742496.stgit@pluto.themaw.net> References: <148577164094.9801.4775075118014742496.stgit@pluto.themaw.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GUI environments seem to be becoming more agressive at scanning filesystems, to the point where autofs cannot expire mounts at all. This is one key reason the update of the autofs dentry info last_used field is done in the expire system when the dentry is seen to be in use. But somewhere along the way instances of the update has crept back into the autofs path walk functions which, with the more aggressive file access patterns, is preventing expiration. Changing the update in the path walk functions allows autofs to at least make progress in spite of frequent immediate re-mounts from file accesses. Signed-off-by: Ian Kent --- fs/autofs4/root.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- 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 diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index a11f731..6ddd4fa 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -281,8 +281,8 @@ static int autofs4_mount_wait(struct dentry *dentry, bool rcu_walk) pr_debug("waiting for mount name=%pd\n", dentry); status = autofs4_wait(sbi, dentry, NFY_MOUNT); pr_debug("mount wait done status=%d\n", status); + ino->last_used = jiffies; } - ino->last_used = jiffies; return status; } @@ -319,16 +319,21 @@ 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; - ino = autofs4_dentry_ino(new); - ino->last_used = jiffies; - dput(path->dentry); - path->dentry = new; + 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; + } } return path->dentry; }