Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp872947ybv; Sat, 22 Feb 2020 17:21:19 -0800 (PST) X-Google-Smtp-Source: APXvYqxWwYWTJho3OTXhPxJkZL3ixX7/suamgVEz3hHws+/7i2ew4x9sEa+B2LtFWgeG1lsmiIka X-Received: by 2002:a05:6830:1e6b:: with SMTP id m11mr35859390otr.293.1582420879726; Sat, 22 Feb 2020 17:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582420879; cv=none; d=google.com; s=arc-20160816; b=CkVzdVz+pwJ/9E+0Sx2fvLDJNhFEpMpenR6Eh/F4bF6JNd5D2P7zsL41TI5+cDkyKK 9vTIOvPM+8tP179ATlF1K75YTTYPorf50nwIQPYrKkisJNK34uJ5wwZYlQnYDX9jy/pT M0p1N1D1GwSqTwJjEOb/dsob29AUjfvZa1q35r95L3sB++yyhHTySIlbDBGGtDVOWbXJ nhPAjQor1/GeQq27ZbnJOJFrZ+u3USdZAfrADEsEEECpE+u4PgY9d1yF5jwbaIHnnKyQ zKg0X2hQ92i5omz46gTuC5n5CYqVZ9Ho3dziaJJnEhzRTjmM4dvT8D/2yc95erJL1G+C REUA== 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=9RidnQr05Tz0vLFer5CfthN0lra91UcAUhzrw+F7n3M=; b=0Pu14zbY3se09VJmKuEQqXWorBTT2FoxeXKhAkvjo5sgp0k5YN/5PmcrtCoEAY051K u0551jCLW3Zz+NCi4pMiBFbVSdbcL5KeKdnROGvVgm596CPE3Y6jnrU8ZepQia5zMnn/ OSGWRiYAk0Hp5PcP9rtKNiw3bhAweX0ynnV2e3IePZ4wXplHq+1radImyeZTXyB4sU+8 OqvBMU9YYt0X5v0VcgMt3FHcK/xovybLoyYgIyrA/B5MvVN08jN4wr1RIc7loYZ5snaD aJsZ0hlpMAB9bkKC7r6ZHoPDtlIL/Mc2VxEIYKRCz2ZSVODSiUkS89ZHjjdqIOiRfqN/ ch3w== 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 e7si3963204otr.183.2020.02.22.17.21.07; Sat, 22 Feb 2020 17:21:19 -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 S1727197AbgBWBVB (ORCPT + 99 others); Sat, 22 Feb 2020 20:21:01 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:50172 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbgBWBVA (ORCPT ); Sat, 22 Feb 2020 20:21:00 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j5fwo-00HDge-JV; Sun, 23 Feb 2020 01:20:44 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Linus Torvalds Subject: [RFC][PATCH v2 17/34] expand the only remaining call of path_lookup_conditional() Date: Sun, 23 Feb 2020 01:16:09 +0000 Message-Id: <20200223011626.4103706-17-viro@ZenIV.linux.org.uk> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200223011626.4103706-1-viro@ZenIV.linux.org.uk> References: <20200223011154.GY23230@ZenIV.linux.org.uk> <20200223011626.4103706-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 6f1f46b931a6..3eed5784942a 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -858,13 +858,6 @@ static int set_root(struct nameidata *nd) return 0; } -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) { @@ -1312,8 +1305,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.11.0