Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2007 10:40:39 -0700
From:      Alfred Perlstein <alfred@freebsd.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cvs-src@FreeBSD.org, src-committers@FreeBSD.org, Robert Watson <rwatson@FreeBSD.org>, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/kern vfs_lookup.c
Message-ID:  <20070402174039.GW61362@elvis.mu.org>
In-Reply-To: <20070401064404.B9096@besplex.bde.org>
References:  <200703311608.l2VG8oNE086672@repoman.freebsd.org> <20070401064404.B9096@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
* Bruce Evans <bde@zeta.org.au> [070331 13:48] wrote:
> On Sat, 31 Mar 2007, Robert Watson wrote:
> 
> >rwatson     2007-03-31 16:08:50 UTC
> >
> > FreeBSD src repository
> >
> > Modified files:
> >   sys/kern             vfs_lookup.c
> > Log:
> > Rather than ignoring any error return from getnewvnode() in nameiinit(),
> > explicitly test and panic.  This should not ever happen, but if it does,
> > this is a preferred failure mode to a NULL pointer dereference in kernel.
> 
> No, a null pointer dereference is far preferable since it takes less code
> and is easier to debug.

Perhaps for the developer, but because of kernel differences it's 
preferable to have a known panic location, ie 'pc' will be different
for different kernel configs and different platforms whereas a 
panic will be static across all deployments.

That said, a KASSERT might be more appropriate, admittedly I haven't
checked to see if that's what was inserted.

-- 
- Alfred Perlstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070402174039.GW61362>