提交 030c7e0b 编写于 作者: D Danilo Krummrich 提交者: Al Viro

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

Use path_equal() to detect whether we're already in root.
Signed-off-by: NDanilo Krummrich <danilokrummrich@dk-develop.de>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
上级 75abe329
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册