Skip to content

Commit 030c7e0

Browse files
Danilo KrummrichAl Viro
authored andcommitted
vfs: namei: use path_equal() in follow_dotdot()
Use path_equal() to detect whether we're already in root. Signed-off-by: Danilo Krummrich <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 75abe32 commit 030c7e0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/namei.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,10 +1438,8 @@ static int path_parent_directory(struct path *path)
14381438
static int follow_dotdot(struct nameidata *nd)
14391439
{
14401440
while(1) {
1441-
if (nd->path.dentry == nd->root.dentry &&
1442-
nd->path.mnt == nd->root.mnt) {
1441+
if (path_equal(&nd->path, &nd->root))
14431442
break;
1444-
}
14451443
if (nd->path.dentry != nd->path.mnt->mnt_root) {
14461444
int ret = path_parent_directory(&nd->path);
14471445
if (ret)

0 commit comments

Comments
 (0)