Subject: Re: pwd returning duplicate directory in path
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: tech-kern
Date: 02/20/2004 18:05:21
enami tsugutomo <enami@sm.sony.co.jp> writes:

> reported on alpha.  The auto variable `vpid' is defined as int so
> u_long value is trucated.  Ditto for cache_lookup().

Here is a possible patch against 1.6 tree (as the -current no longer
has v_id).  It also includes the result of cvs update -j1.21 -j1.22
vfs_getcwd.c.

enami.
Index: vfs_cache.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_cache.c,v
retrieving revision 1.35
diff -u -r1.35 vfs_cache.c
--- vfs_cache.c	8 Mar 2002 20:48:42 -0000	1.35
+++ vfs_cache.c	20 Feb 2004 05:54:42 -0000
@@ -113,7 +113,8 @@
 	struct namecache *ncp;
 	struct nchashhead *ncpp;
 	struct vnode *vp;
-	int vpid, error;
+	u_long vpid;
+	int error;
 
 	if (!doingcache) {
 		cnp->cn_flags &= ~MAKEENTRY;
Index: vfs_getcwd.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_getcwd.c,v
retrieving revision 1.15
diff -u -r1.15 vfs_getcwd.c
--- vfs_getcwd.c	12 Nov 2001 15:25:37 -0000	1.15
+++ vfs_getcwd.c	20 Feb 2004 05:54:42 -0000
@@ -310,8 +310,9 @@
 	char *bufp;
 {
 	struct vnode *lvp, *uvp = NULL;
+	char *obp = *bpp;
+	u_long vpid;
 	int error;
-	int vpid;
 	
 	lvp = *lvpp;
 	
@@ -354,6 +355,7 @@
 		 */
 		if (!error) vput(uvp);
 		*uvpp = NULL;
+		*bpp = obp;
 		
 		error = vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY);