* [PATCH resend] vfs: namei: use path_equal() in follow_dotdot()
@ 2018-04-24 6:25 Danilo Krummrich
0 siblings, 0 replies; only message in thread
From: Danilo Krummrich @ 2018-04-24 6:25 UTC (permalink / raw)
To: viro, linux-fsdevel, linux-kernel; +Cc: Danilo Krummrich
Use path_equal() to detect whether we're already in root.
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
---
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-24 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-24 6:25 [PATCH resend] vfs: namei: use path_equal() in follow_dotdot() Danilo Krummrich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).