Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Partially revert part of -r1.167; it was wrong. Fro...



details:   https://anonhg.NetBSD.org/src/rev/b099d8504972
branches:  trunk
changeset: 764111:b099d8504972
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Mon Apr 11 18:24:49 2011 +0000

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

diffstat:

 sys/kern/vfs_lookup.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 08850fa9288a -r b099d8504972 sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Mon Apr 11 18:02:11 2011 +0000
+++ b/sys/kern/vfs_lookup.c     Mon Apr 11 18:24:49 2011 +0000
@@ -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;
                }



Home | Main Index | Thread Index | Old Index