cvs commit: src/sys/kern vfs_lookup.c

Alfred Perlstein alfred at freebsd.org
Mon Apr 2 17:40:39 UTC 2007


* Bruce Evans <bde at 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


More information about the cvs-src mailing list