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.
This commit is contained in:
dholland 2011-05-16 15:09:31 +00:00
parent 3f0fc12d5a
commit bd77476310

View File

@ -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 @@ namei_oneroot(struct namei_state *state, struct vnode *forcecwd,
* current node.
*/
if (cnp->cn_nameptr[0] == '\0') {
vref(searchdir);
foundobj = searchdir;
searchdir = NULL;
cnp->cn_flags |= ISLASTCN;
/* bleh */