[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200119031738.2681033-17-viro@ZenIV.linux.org.uk>
Date: Sun, 19 Jan 2020 03:17:29 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: linux-fsdevel@...r.kernel.org
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Aleksa Sarai <cyphar@...har.com>,
David Howells <dhowells@...hat.com>,
Eric Biederman <ebiederm@...ssion.com>,
Christian Brauner <christian.brauner@...ntu.com>,
Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH 17/17] expand the only remaining call of path_lookup_conditional()
From: Al Viro <viro@...iv.linux.org.uk>
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
---
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
Powered by blists - more mailing lists