فهرست منبع

Make vfs_path_lookup() use starting point as root

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 16 سال پیش
والد
کامیت
5b85711953
1فایلهای تغییر یافته به همراه4 افزوده شده و 5 حذف شده
  1. 4 5
      fs/namei.c

+ 4 - 5
fs/namei.c

@@ -1123,21 +1123,20 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
 	nd->last_type = LAST_ROOT;
 	nd->last_type = LAST_ROOT;
 	nd->flags = flags;
 	nd->flags = flags;
 	nd->depth = 0;
 	nd->depth = 0;
-	nd->root.mnt = NULL;
 
 
 	nd->path.dentry = dentry;
 	nd->path.dentry = dentry;
 	nd->path.mnt = mnt;
 	nd->path.mnt = mnt;
 	path_get(&nd->path);
 	path_get(&nd->path);
+	nd->root = nd->path;
+	path_get(&nd->root);
 
 
 	retval = path_walk(name, nd);
 	retval = path_walk(name, nd);
 	if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry &&
 	if (unlikely(!retval && !audit_dummy_context() && nd->path.dentry &&
 				nd->path.dentry->d_inode))
 				nd->path.dentry->d_inode))
 		audit_inode(name, nd->path.dentry);
 		audit_inode(name, nd->path.dentry);
 
 
-	if (nd->root.mnt) {
-		path_put(&nd->root);
-		nd->root.mnt = NULL;
-	}
+	path_put(&nd->root);
+	nd->root.mnt = NULL;
 
 
 	return retval;
 	return retval;
 }
 }