Skip to contentSkip to conversation

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

PATCH Superseded Danilo Krummrich 1 participant 1 message Apr 9, 2018 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vfs: namei: use path_equal() in follow_dotdot()

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

---
 fs/namei.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
fs/namei.c +1 -3
index a66ed5a1622a..d1e0f6cc4c47 100644
@@ -1437,10 +1437,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)
Signature · 1 line
2.16.3