Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 May 2011 15:41:27 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Jaakko Heinonen <jh@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r221597 - head/sys/kern
Message-ID:  <20110507124127.GP48734@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110507122048.GA1846@a91-153-123-205.elisa-laajakaista.fi>
References:  <201105071110.p47BAwmU096094@svn.freebsd.org> <20110507114856.GN48734@deviant.kiev.zoral.com.ua> <20110507122048.GA1846@a91-153-123-205.elisa-laajakaista.fi>

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

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

On Sat, May 07, 2011 at 03:20:48PM +0300, Jaakko Heinonen wrote:
> On 2011-05-07, Kostik Belousov wrote:
> > > @@ -310,6 +310,7 @@ getenv(const char *name)
> > >  	int len;
> > > =20
> > >  	if (dynamic_kenv) {
> > > +		WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "getenv");
> > >  		mtx_lock(&kenv_lock);
> > >  		cp =3D _getenv_dynamic(name, NULL);
> > >  		if (cp !=3D NULL) {
> >=20
> > This might be somewhat excessive. Since malloc() warns or panics anyway,
> > what about moving the WITNESS_WARN into "not found" branch ?
>=20
> Is this better?
Most likely, at least this is exactly what I meant.

>=20
> %%%
> Index: sys/kern/kern_environment.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
> --- sys/kern/kern_environment.c	(revision 221597)
> +++ sys/kern/kern_environment.c	(working copy)
> @@ -310,7 +310,6 @@ getenv(const char *name)
>  	int len;
> =20
>  	if (dynamic_kenv) {
> -		WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "getenv");
>  		mtx_lock(&kenv_lock);
>  		cp =3D _getenv_dynamic(name, NULL);
>  		if (cp !=3D NULL) {
> @@ -322,6 +321,8 @@ getenv(const char *name)
>  		} else {
>  			mtx_unlock(&kenv_lock);
>  			ret =3D NULL;
> +			WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
> +			    "getenv");
>  		}
>  	} else
>  		ret =3D _getenv_static(name);
> %%%
>=20
> --=20
> Jaakko

--ExLobwx2ErZCZZ6w
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iEYEARECAAYFAk3FPfcACgkQC3+MBN1Mb4itqgCgji+tg0Ghytbr7QggkpqKFmPP
HC4AnjMTMUq6lLF7yg8i1QpIeLDzsz19
=2pTf
-----END PGP SIGNATURE-----

--ExLobwx2ErZCZZ6w--



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