Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Nov 2012 18:21:52 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Pawel Jakub Dawidek <pjd@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r243142 - in head/sys: fs/nfsclient kern sys
Message-ID:  <20121125162152.GA3013@kib.kiev.ua>
In-Reply-To: <20121124222408.GH1460@garage.freebsd.pl>
References:  <201211160825.qAG8P6v6047507@svn.freebsd.org> <20121124222408.GH1460@garage.freebsd.pl>

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

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

On Sat, Nov 24, 2012 at 11:24:08PM +0100, Pawel Jakub Dawidek wrote:
> On Fri, Nov 16, 2012 at 08:25:06AM +0000, Konstantin Belousov wrote:
> > Author: kib
> > Date: Fri Nov 16 08:25:06 2012
> > New Revision: 243142
> > URL: http://svnweb.freebsd.org/changeset/base/243142
> >=20
> > Log:
> >   In pget(9), if PGET_NOTWEXIT flag is not specified, also search the
> >   zombie list for the pid. This allows several kern.proc sysctls to
> >   report useful information for zombies.
> >  =20
> >   Hold the allproc_lock around all searches instead of relocking it.
> >   Remove private pfind_locked() from the new nfs client code.
> >  =20
> >   Requested and reviewed by:	pjd
> >   Tested by:	pho
> >   MFC after:	3 weeks
> [...]
> > @@ -364,12 +374,16 @@ pget(pid_t pid, int flags, struct proc *
> >  	struct proc *p;
> >  	int error;
> > =20
> > +	sx_slock(&allproc_lock);
> >  	if (pid <=3D PID_MAX)
> > -		p =3D pfind(pid);
> > +		p =3D pfind_locked(pid);
> >  	else if ((flags & PGET_NOTID) =3D=3D 0)
> > -		p =3D pfind_tid(pid);
> > +		p =3D pfind_tid_locked(pid);
> >  	else
> >  		p =3D NULL;
> > +	if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0)
> > +		p =3D zpfind_locked(pid);
> > +	sx_sunlock(&allproc_lock);
> >  	if (p =3D=3D NULL)
> >  		return (ESRCH);
>=20
> I think we should move zpfind_locked() under 'pid <=3D PID_MAX':
>=20
> 	sx_slock(&allproc_lock);
> 	if (pid <=3D PID_MAX) {
> 		p =3D pfind_locked(pid);
> 		if (p =3D=3D NULL && (flags & PGET_NOTWEXIT) =3D=3D 0)
> 			p =3D zpfind_locked(pid);
> 	} else if ((flags & PGET_NOTID) =3D=3D 0) {
> 		p =3D pfind_tid_locked(pid);
> 	} else {
> 		p =3D NULL;
> 	}
> 	sx_sunlock(&allproc_lock);
> 	if (p =3D=3D NULL)
> 		return (ESRCH);
>=20

Yes, I agree. Please remove {} for one-line blocks.

--KsGdsel6WgEHnImy
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlCyRZ8ACgkQC3+MBN1Mb4jMWwCgsHJftyDD4T0q64Nfbrrnb4O7
KGIAoNJv5o1cUOxuReUv82kme48ikmZQ
=sWF0
-----END PGP SIGNATURE-----

--KsGdsel6WgEHnImy--



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