Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 030c7e0b authored by Danilo Krummrich's avatar Danilo Krummrich Committed by Al Viro
Browse files

vfs: namei: use path_equal() in follow_dotdot()



Use path_equal() to detect whether we're already in root.

Signed-off-by: default avatarDanilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 75abe329
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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)