Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1125654ybl; Sat, 18 Jan 2020 19:24:33 -0800 (PST) X-Google-Smtp-Source: APXvYqz/Q0JBKG2yp2IKNuTldbVJn9qQopU7dY4I/Tl5C+eDRcejKsCPD5BHhJ1bsvzt6Q5Fn0IM X-Received: by 2002:aca:c493:: with SMTP id u141mr8971872oif.62.1579404273633; Sat, 18 Jan 2020 19:24:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579404273; cv=none; d=google.com; s=arc-20160816; b=osYlQl/a8WgKx+3nE++tsZ/fTrhJUFa2fj7W/EUGDitbX2nOavp60DLST0qFA3+g4z SpngxFgHZZD5gvllfKLFJ3mge6ZEMH2tsNadkR8YAf667WvK1DxZmDk4BCCnOikMBn2n P3kbndQ9+f9i6K6v62hR2jkVJr1fp/qUAg+aESiBQMlmY/2F7Eel1OxvZ2zTOXi1b0/I S0SWC1uZOfGbPIRLhhdZ0tgUAjWZbeh/h2toTK4nNjMqDtGOI3KGVpGE5/OWCQftni0h BXIPfdLNwvX7DgdDABrHeEpDb+l22MJThWA+fzqenKpHzAkyoKkwyW4Nf/6F8X1JW8I7 SHWQ== 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=TAI9VpIjMOLToIjLIRlJy+LVJjQopaYRWuyBOgX128M=; b=MFU3FEJaC1asR6E5gzzunODmS86msu0+Z5FjNhiqU6TtMVnCkjrSjcSrsrr2LIaPri KvV43tlmwOByxArerHdZmXD+dGVQdXKXVxakS4QrtYNF+76/bzVKeToBpP/MnCUr7o74 hGw1pV00jYYX966dc5OFjw46uEY99SiLxw9WmpbjtNDG7IiZ7RjPcBMSvEovtPK6GzU1 MMWqUTOexTd6Pgrl58myDDLUd54WfnZ/4pAva2bJgH5fXIaYxwcB6kylr5SzvycaTquk tAO1JRa01g/cWFbTQM5sf/DsAxPGNqFmoRHtb91uyiRyhKyZhDE4o9gTCmdz1wp5MfMv LO6A== 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 n8si17874073otr.102.2020.01.18.19.24.21; Sat, 18 Jan 2020 19:24:33 -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 S1726573AbgASDX2 (ORCPT + 99 others); Sat, 18 Jan 2020 22:23:28 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:56890 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725497AbgASDX1 (ORCPT ); Sat, 18 Jan 2020 22:23:27 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1it1Ai-00BFdV-W6; Sun, 19 Jan 2020 03:22:51 +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 17/17] expand the only remaining call of path_lookup_conditional() Date: Sun, 19 Jan 2020 03:17:29 +0000 Message-Id: <20200119031738.2681033-17-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 Signed-off-by: Al Viro --- fs/namei.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index 6852a0dcb25d..e840472ab9bf 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -816,13 +816,6 @@ static void set_root(struct nameidata *nd) } } -static void path_put_conditional(struct path *path, struct nameidata *nd) -{ - dput(path->dentry); - if (path->mnt != nd->path.mnt) - mntput(path->mnt); -} - static inline void path_to_nameidata(const struct path *path, struct nameidata *nd) { @@ -1233,8 +1226,11 @@ static int follow_managed(struct path *path, struct nameidata *nd) ret = 1; if (ret > 0 && unlikely(d_flags_negative(flags))) ret = -ENOENT; - if (unlikely(ret < 0)) - path_put_conditional(path, nd); + if (unlikely(ret < 0)) { + dput(path->dentry); + if (path->mnt != nd->path.mnt) + mntput(path->mnt); + } return ret; } -- 2.20.1