From owner-svn-src-head@FreeBSD.ORG Sat Feb 14 21:18:59 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3146F1065670; Sat, 14 Feb 2009 21:18:59 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from creme-brulee.marcuscom.com (marcuscom-pt.tunnel.tserv1.fmt.ipv6.he.net [IPv6:2001:470:1f00:ffff::1279]) by mx1.freebsd.org (Postfix) with ESMTP id CF2AD8FC18; Sat, 14 Feb 2009 21:18:58 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from [IPv6:2001:470:1f00:2464::4] (shumai.marcuscom.com [IPv6:2001:470:1f00:2464::4]) by creme-brulee.marcuscom.com (8.14.3/8.14.3) with ESMTP id n1ELK0cT077141; Sat, 14 Feb 2009 16:20:00 -0500 (EST) (envelope-from marcus@FreeBSD.org) From: Joe Marcus Clarke To: Kostik Belousov In-Reply-To: <20090214211624.GS2723@deviant.kiev.zoral.com.ua> References: <200902142112.n1ELCOJg030474@svn.freebsd.org> <20090214211624.GS2723@deviant.kiev.zoral.com.ua> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-jLw1QV6hEssTVeSFVuUz" Organization: FreeBSD, Inc. Date: Sat, 14 Feb 2009 16:19:02 -0500 Message-Id: <1234646342.42927.100.camel@shumai.marcuscom.com> Mime-Version: 1.0 X-Mailer: Evolution 2.24.4 FreeBSD GNOME Team Port X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on creme-brulee.marcuscom.com Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r188613 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Feb 2009 21:18:59 -0000 --=-jLw1QV6hEssTVeSFVuUz Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 > >=20 > > Log: > > Change two KASSERTS to printfs and simple returns. Stress testing ha= s > > 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. > > =20 > > Tested by: pho > > Discovered by: phobot > > Reviewed by: kib > > Approved by: kib > >=20 > > Modified: > > head/sys/kern/kern_descrip.c > >=20 > > Modified: head/sys/kern/kern_descrip.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- 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 =3D type; > > kif->kf_type =3D KF_TYPE_VNODE; > > /* This function only handles directories. */ > > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_osysctl: vnode not= directory")); > > + if (vp->v_type !=3D VDIR) { > > + printf("export_vnode_for_osysctl: vnode not directory: %d\n", > > + vp->v_type); > > + vrele(vp); > > + return (ENOTDIR); > > + } > > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > > =20 > > /* > > @@ -2779,7 +2784,12 @@ export_vnode_for_sysctl(struct vnode *vp > > kif->kf_fd =3D type; > > kif->kf_type =3D KF_TYPE_VNODE; > > /* This function only handles directories. */ > > - KASSERT(vp->v_type =3D=3D VDIR, ("export_vnode_for_sysctl: vnode not = directory")); > > + if (vp->v_type !=3D VDIR) { > > + printf("export_vnode_for_sysctl: vnode not directory: %d\n", > > + vp->v_type); > > + vrele(vp); > > + return (ENOTDIR); > > + } > > kif->kf_vnode_type =3D KF_VTYPE_VDIR; > > =20 > > /* > 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 --=20 Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome --=-jLw1QV6hEssTVeSFVuUz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkmXNUQACgkQb2iPiv4Uz4fX2ACgp3cCMXa7jTPhCsCEQKAAiI0G dqQAn3rHSXEOYDs4+ZODPY991hoe03sR =Wf79 -----END PGP SIGNATURE----- --=-jLw1QV6hEssTVeSFVuUz--