Module Name:    src
Committed By:   dholland
Date:           Mon Apr 11 02:21:02 UTC 2011

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

Log Message:
Add comment warning about case with LOCKPARENT but not LOCKLEAF. bleh.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 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.171 src/sys/kern/vfs_lookup.c:1.172
--- src/sys/kern/vfs_lookup.c:1.171	Mon Apr 11 02:20:15 2011
+++ src/sys/kern/vfs_lookup.c	Mon Apr 11 02:21:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.171 2011/04/11 02:20:15 dholland Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.172 2011/04/11 02:21:01 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.171 2011/04/11 02:20:15 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.172 2011/04/11 02:21:01 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1292,6 +1292,17 @@
 			return EROFS;
 		}
 		if ((cnp->cn_flags & LOCKLEAF) == 0) {
+			/*
+			 * Note: if LOCKPARENT but not LOCKLEAF is
+			 * set, and searchdir == foundobj, this code
+			 * necessarily unlocks the parent as well as
+			 * the leaf. That is, just because you specify
+			 * LOCKPARENT doesn't mean you necessarily get
+			 * a locked parent vnode. The code in
+			 * vfs_syscalls.c, and possibly elsewhere,
+			 * that uses this combination "knows" this, so
+			 * it can't be safely changed. Feh. XXX
+			 */
 			VOP_UNLOCK(foundobj);
 		}
 

Reply via email to