diff options
author | Danilo Krummrich <danilokrummrich@dk-develop.de> | 2018-04-23 04:30:59 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-05-17 22:19:39 -0400 |
commit | 030c7e0bb723e3de6354d1a85df0543197efec1a (patch) | |
tree | 92b63be300702a51bc744364762c89e1753111d2 | |
parent | 75abe32946604887a3fa600eb0956e9946d4170c (diff) |
vfs: namei: use path_equal() in follow_dotdot()
Use path_equal() to detect whether we're already in root.
Signed-off-by: Danilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/namei.c | 4 |
1 files changed, 1 insertions, 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) | |||
1438 | static int follow_dotdot(struct nameidata *nd) | 1438 | static int follow_dotdot(struct nameidata *nd) |
1439 | { | 1439 | { |
1440 | while(1) { | 1440 | while(1) { |
1441 | if (nd->path.dentry == nd->root.dentry && | 1441 | if (path_equal(&nd->path, &nd->root)) |
1442 | nd->path.mnt == nd->root.mnt) { | ||
1443 | break; | 1442 | break; |
1444 | } | ||
1445 | if (nd->path.dentry != nd->path.mnt->mnt_root) { | 1443 | if (nd->path.dentry != nd->path.mnt->mnt_root) { |
1446 | int ret = path_parent_directory(&nd->path); | 1444 | int ret = path_parent_directory(&nd->path); |
1447 | if (ret) | 1445 | if (ret) |