Received: by 10.192.165.148 with SMTP id m20csp4288907imm; Mon, 23 Apr 2018 23:34:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iUYLM6JIH7gUaLkdQiFawvwo99EmCY6M80dumOyKJPTrxUM7Stu54rDfSOGPT8iegSBRJ X-Received: by 10.98.220.138 with SMTP id c10mr19696981pfl.183.1524551669223; Mon, 23 Apr 2018 23:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524551669; cv=none; d=google.com; s=arc-20160816; b=bCpTe1rL0W3l7wDAA0HAfVPaY2G9Cj3Pgbbiu02WpxjpdBm0Q9kDwIIVaqNz8QfbTG LRebn32+bTHXJXsGxHiBxcjVFVCC5riDpNUWth/w1XWjo7nuqf1xQ6lBzwyL6grFoEHo 1kBXydQoLVR10f5pc5xhrrily6ZRB5izXAzoVcj//G9O4MU12yxHCr+P4DsQflDRl/En TQ3n+Mb3IqOjmRBoPBG8n3urzndMfQH1W9+koRNaldJCU8ByLxQmmID02NCjskpVTu0X g8KaURcho0vV8Uevp4+BQaXNFI5wlo7oNVIZaBGtppcK+Iq0uwqCPYsAxdukOPyON1ii 1YNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=pGZwX9ab+5OsDb0wVIH6qJGdJTGyhxJTpc0CIOQN6VU=; b=leJhkpOneGN6NTxpDaymSpssRDSrXHemM7dmnKV4P9eO/pXrKCH/fSriXSxdPkBMaY DPy75awLsOH4P3p45N74GpuF4FaukfH+ZlRuy6pgKaArkuQVy8GkKs2QhyZfrUOxxrlL ikMNiLhLJuBXx1YrTvn2EAEjzcb4+Tr8i+nNtsaVRKRoyEfIDMdNw+sPfYAqS3LuquGT 898AYrpEsheW55HFW3Ira1RVQx4fiSxmVFPKuZMjv7rSTKqey+49rCbeX6Wa6wXbFpDj 3QQdny++LDhYb5Krb4Jz/yJAyw6iKfU1ZoBNVS+rSlkszsbBd3jszsyNnZG8iJ3qCK1G vc3g== 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 b129si10878039pgc.387.2018.04.23.23.34.14; Mon, 23 Apr 2018 23:34:29 -0700 (PDT) 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 S1755964AbeDXGZf (ORCPT + 99 others); Tue, 24 Apr 2018 02:25:35 -0400 Received: from hs01.dk-sys.de ([173.249.23.66]:40986 "EHLO hs01.dk-sys.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbeDXGZe (ORCPT ); Tue, 24 Apr 2018 02:25:34 -0400 From: Danilo Krummrich To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Danilo Krummrich Subject: [PATCH resend] vfs: namei: use path_equal() in follow_dotdot() Date: Tue, 24 Apr 2018 08:25:31 +0200 Message-Id: <20180424062531.14600-1-danilokrummrich@dk-develop.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use path_equal() to detect whether we're already in root. Signed-off-by: Danilo Krummrich --- fs/namei.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 186bd2464fd5..6f0dc40f88c5 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1438,10 +1438,8 @@ static int path_parent_directory(struct path *path) static int follow_dotdot(struct nameidata *nd) { while(1) { - if (nd->path.dentry == nd->root.dentry && - nd->path.mnt == nd->root.mnt) { + if (path_equal(&nd->path, &nd->root)) break; - } if (nd->path.dentry != nd->path.mnt->mnt_root) { int ret = path_parent_directory(&nd->path); if (ret) -- 2.17.0