Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Feb 2009 23:16:24 +0200
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Joe Marcus Clarke <marcus@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r188613 - head/sys/kern
Message-ID:  <20090214211624.GS2723@deviant.kiev.zoral.com.ua>
In-Reply-To: <200902142112.n1ELCOJg030474@svn.freebsd.org>
References:  <200902142112.n1ELCOJg030474@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--TMgB3/Ch1aWgZB1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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 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.
>  =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 d=
irectory"));
> +	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 di=
rectory"));
> +	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 ?

--TMgB3/Ch1aWgZB1L
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkmXNKgACgkQC3+MBN1Mb4i26QCeMFBrJYiZ69U6AiTKorGu/bXE
u44AoOjEldye7BA1IB01q1BoPS0Yb689
=87vL
-----END PGP SIGNATURE-----

--TMgB3/Ch1aWgZB1L--



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