Subject: Re: pwd returning duplicate directory in path
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: enami tsugutomo <enami@sm.sony.co.jp>
List: tech-kern
Date: 02/16/2004 12:43:52
Manuel Bouyer <bouyer@antioche.lip6.fr> writes:

> has anyone else seen this, or has an idea about this bug ?

I guess we need to rewind the bp if cache_revlookup() succeeded but
getcwd_getcache() finally returns `not found'.

Attached is an untested patch for -current.

enami.

Index: vfs_getcwd.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_getcwd.c,v
retrieving revision 1.21
diff -u -r1.21 vfs_getcwd.c
--- vfs_getcwd.c	30 Jul 2003 12:10:57 -0000	1.21
+++ vfs_getcwd.c	16 Feb 2004 03:24:04 -0000
@@ -308,6 +308,7 @@
 	char *bufp;
 {
 	struct vnode *lvp, *uvp = NULL;
+	char *obp = *bpp;
 	int error;
 	
 	lvp = *lvpp;
@@ -342,6 +343,7 @@
 	 * didn't change while we were waiting for the lock.
 	 */
 	if (error) {
+		*bpp = obp;
 		/*
 		 * Oops, we missed.  If the vget failed, or the
 		 * capability changed, try to get our lock back; if