svn commit: r188613 - head/sys/kern

Joe Marcus Clarke marcus at FreeBSD.org
Sat Feb 14 13:18:59 PST 2009


On Sat, 2009-02-14 at 23:16 +0200, Kostik Belousov wrote:
> On Sat, Feb 14, 2009 at 09:12:24PM +0000, Joe Marcus Clarke wrote:
> > Author: marcus (doc,ports committer)
> > Date: Sat Feb 14 21:12:24 2009
> > New Revision: 188613
> > URL: http://svn.freebsd.org/changeset/base/188613
> > 
> > Log:
> >   Change two KASSERTS to printfs and simple returns.  Stress testing has
> >   revealed that a process' current working directory can be VBAD if the
> >   directory is removed.  This can trigger a panic when procstat -f PID is
> >   run.
> >   
> >   Tested by:	pho
> >   Discovered by:	phobot
> >   Reviewed by:	kib
> >   Approved by:	kib
> > 
> > Modified:
> >   head/sys/kern/kern_descrip.c
> > 
> > Modified: head/sys/kern/kern_descrip.c
> > ==============================================================================
> > --- head/sys/kern/kern_descrip.c	Sat Feb 14 21:08:40 2009	(r188612)
> > +++ head/sys/kern/kern_descrip.c	Sat Feb 14 21:12:24 2009	(r188613)
> > @@ -2532,7 +2532,12 @@ export_vnode_for_osysctl(struct vnode *v
> >  	kif->kf_fd = type;
> >  	kif->kf_type = KF_TYPE_VNODE;
> >  	/* This function only handles directories. */
> > -	KASSERT(vp->v_type == VDIR, ("export_vnode_for_osysctl: vnode not directory"));
> > +	if (vp->v_type != VDIR) {
> > +		printf("export_vnode_for_osysctl: vnode not directory: %d\n",
> > +		    vp->v_type);
> > +		vrele(vp);
> > +		return (ENOTDIR);
> > +	}
> >  	kif->kf_vnode_type = KF_VTYPE_VDIR;
> >  
> >  	/*
> > @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp
> >  	kif->kf_fd = type;
> >  	kif->kf_type = KF_TYPE_VNODE;
> >  	/* This function only handles directories. */
> > -	KASSERT(vp->v_type == VDIR, ("export_vnode_for_sysctl: vnode not directory"));
> > +	if (vp->v_type != VDIR) {
> > +		printf("export_vnode_for_sysctl: vnode not directory: %d\n",
> > +		    vp->v_type);
> > +		vrele(vp);
> > +		return (ENOTDIR);
> > +	}
> >  	kif->kf_vnode_type = KF_VTYPE_VDIR;
> >  
> >  	/*
> You are fast. Do we need these printf ?

I thought about it.  My first patch actually didn't have them.  But I
thought I'd leave them in to see how common this occurrence was in the
wild.  I'm not in love with them.  If you think they should go, I'll
pull them.

Joe

-- 
Joe Marcus Clarke
FreeBSD GNOME Team      ::      gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20090214/d5d21cbc/attachment.pgp


More information about the svn-src-all mailing list