Module Name:    src
Committed By:   jakllsch
Date:           Mon Apr 11 18:24:49 UTC 2011

Modified Files:
        src/sys/kern: vfs_lookup.c

Log Message:
Partially revert part of -r1.167; it was wrong. From dholland.


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/kern/vfs_lookup.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.173 src/sys/kern/vfs_lookup.c:1.174
--- src/sys/kern/vfs_lookup.c:1.173	Mon Apr 11 02:21:17 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 11 18:24:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.173 2011/04/11 02:21:17 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.174 2011/04/11 18:24:49 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.173 2011/04/11 02:21:17 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.174 2011/04/11 18:24:49 jakllsch Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -673,6 +673,8 @@
  *
  * Updates searchdir. inhibitmagic causes magic symlinks to not be
  * interpreted; this is used by nfsd.
+ *
+ * Unlocks foundobj on success (ugh)
  */
 static inline int
 namei_follow(struct namei_state *state, int inhibitmagic,
@@ -745,6 +747,9 @@
 	/* we're now starting from the beginning of the buffer again */
 	cnp->cn_nameptr = ndp->ni_pnbuf;
 
+	/* must unlock this before relocking searchdir */
+	VOP_UNLOCK(foundobj);
+
 	/*
 	 * Check if root directory should replace current directory.
 	 */
@@ -1204,7 +1209,8 @@
 				ndp->ni_vp = NULL;
 				return error;
 			}
-			vput(foundobj);
+			/* namei_follow unlocks it (ugh) so rele, not put */
+			vrele(foundobj);
 			foundobj = NULL;
 			continue;
 		}

Reply via email to