Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Hack for PR 44961: restore the prior "logic" pertai...



details:   https://anonhg.NetBSD.org/src/rev/67c927ee91aa
branches:  trunk
changeset: 765034:67c927ee91aa
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon May 16 15:09:31 2011 +0000

description:
Hack for PR 44961: restore the prior "logic" pertaining to looking up /
to prevent a crash when attempting rename("/", "foo"). This is not really
what I want going forward and it may cause e.g. rmdir("blah/") to fail, so
if it causes trouble for anyone back it out. The right fix is going to have
to wait until the qemu/tcp_vtw problems I ran into last night get sorted out.

diffstat:

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

diffs (28 lines):

diff -r 48bde48113fe -r 67c927ee91aa sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c     Mon May 16 14:50:36 2011 +0000
+++ b/sys/kern/vfs_lookup.c     Mon May 16 15:09:31 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_lookup.c,v 1.183 2011/04/18 00:47:24 dholland Exp $        */
+/*     $NetBSD: vfs_lookup.c,v 1.184 2011/05/16 15:09:31 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.183 2011/04/18 00:47:24 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.184 2011/05/16 15:09:31 dholland Exp $");
 
 #include "opt_magiclinks.h"
 
@@ -1145,8 +1145,8 @@
                 * current node.
                 */
                if (cnp->cn_nameptr[0] == '\0') {
-                       vref(searchdir);
                        foundobj = searchdir;
+                       searchdir = NULL;
                        cnp->cn_flags |= ISLASTCN;
 
                        /* bleh */



Home | Main Index | Thread Index | Old Index