Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1123687ybl; Sat, 18 Jan 2020 19:21:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzPE81EAKkA8z7prNKDG/gXFdk0nO7qMcR+JtYF5PhzcPLEEmFHe8lWc+bLTyK4cWRFcE42 X-Received: by 2002:a05:6830:1149:: with SMTP id x9mr12011081otq.156.1579404086632; Sat, 18 Jan 2020 19:21:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579404086; cv=none; d=google.com; s=arc-20160816; b=mrSmXlSMgNtgCtRifX9XuPXZecGEaMTLfVHzs2akcQOYn9e0se6GIIZOdT4Qp4pI1p tZJpMcqOC3b+0DQX/nY0ZJXY8ahUoY8YyeJt6LLq+LSJXgev5gHwuVwWGdUaxXppKC5U Q98T46ZGlElnMOVTtONrefunqWqa2bnM3gvYQtRw7FzZwA+QjlgxtuCSAuvw2OnK3xTm thWRGjra5wSBPF17qQnkwKUtr4LZ3HmtXTHDtl2l1dqgo2IvkY/08INYDBYgcl036D/R 90xqBfVW3eonz2q5L8HvHOYBCGBVPz9fZKe/bGVQ4A+/y1Q5WdvIum+k3IbLVB8clS7T LvNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OsKAwZHZoJb7cq3DeOOvbzUCme4Kay8PRUoielM38KA=; b=unzku28fLKFrTPiBNGlHM5RSypFAAAreILYQ5TTl5D7O9Pd3dx9TXAIBoC3qm3ITCf efVipmT5QFisA/AEfFYvZjXDjSfW9msADlijktnwnIdYtaEofZdKNMCGxDpnyJLq2qad gbO73a9Qu23UXumfZdoAM772S8t5Rfqv5ubfsFy7keG9ICwjKVry3104a+UUKG3rHvSU yQLvt45yAKiK4HcdmppcPh5RWl6fZpYN/19kTx/yQqhhYBf+SibbnFkNLL8hUoO9vp4x ySwjti4pH4q3uuXA7NlmKF4gDgpw9YxEjVJ0UwNqEaHZVWpvEjknjth+QZxfiXX4Linr WTqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y18si16557448oix.27.2020.01.18.19.21.15; Sat, 18 Jan 2020 19:21:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726999AbgASDTW (ORCPT + 99 others); Sat, 18 Jan 2020 22:19:22 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:56700 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbgASDTW (ORCPT ); Sat, 18 Jan 2020 22:19:22 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1it16o-00BFVK-AH; Sun, 19 Jan 2020 03:18:47 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Linus Torvalds , linux-kernel@vger.kernel.org, Aleksa Sarai , David Howells , Eric Biederman , Christian Brauner , Al Viro Subject: [PATCH 04/17] follow_automount() doesn't need the entire nameidata Date: Sun, 19 Jan 2020 03:17:16 +0000 Message-Id: <20200119031738.2681033-4-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200119031738.2681033-1-viro@ZenIV.linux.org.uk> References: <20200119031423.GV8904@ZenIV.linux.org.uk> <20200119031738.2681033-1-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Al Viro only the address of ->total_link_count and the flags Signed-off-by: Al Viro --- fs/namei.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index d30a74a18da9..3b6f60c02f8a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1133,7 +1133,7 @@ EXPORT_SYMBOL(follow_up); * - return -EISDIR to tell follow_managed() to stop and return the path we * were called with. */ -static int follow_automount(struct path *path, struct nameidata *nd) +static int follow_automount(struct path *path, int *count, unsigned lookup_flags) { struct dentry *dentry = path->dentry; @@ -1148,13 +1148,12 @@ static int follow_automount(struct path *path, struct nameidata *nd) * as being automount points. These will need the attentions * of the daemon to instantiate them before they can be used. */ - if (!(nd->flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | + if (!(lookup_flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | LOOKUP_OPEN | LOOKUP_CREATE | LOOKUP_AUTOMOUNT)) && dentry->d_inode) return -EISDIR; - nd->total_link_count++; - if (nd->total_link_count >= 40) + if (count && *count++ >= 40) return -ELOOP; return finish_automount(dentry->d_op->d_automount(path), path); @@ -1215,7 +1214,8 @@ static int follow_managed(struct path *path, struct nameidata *nd) /* Handle an automount point */ if (flags & DCACHE_NEED_AUTOMOUNT) { - ret = follow_automount(path, nd); + ret = follow_automount(path, &nd->total_link_count, + nd->flags); if (ret < 0) break; continue; -- 2.20.1