From owner-svn-src-all@FreeBSD.ORG Sat Nov 24 22:23:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F14C742A; Sat, 24 Nov 2012 22:23:02 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id AF4158FC08; Sat, 24 Nov 2012 22:23:01 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id AE275B0D; Sat, 24 Nov 2012 23:21:07 +0100 (CET) Date: Sat, 24 Nov 2012 23:24:08 +0100 From: Pawel Jakub Dawidek To: Konstantin Belousov Subject: Re: svn commit: r243142 - in head/sys: fs/nfsclient kern sys Message-ID: <20121124222408.GH1460@garage.freebsd.pl> References: <201211160825.qAG8P6v6047507@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6lXr1rPCNTf1w0X8" Content-Disposition: inline In-Reply-To: <201211160825.qAG8P6v6047507@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 22:23:03 -0000 --6lXr1rPCNTf1w0X8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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); I think we should move zpfind_locked() under 'pid <=3D PID_MAX': 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 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --6lXr1rPCNTf1w0X8 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCxSQgACgkQForvXbEpPzQLJQCg6aP44W5Mwm8LbPnOFsKlBeKE 5vsAn3LchhKKzzO1dPpbv3uydJfVpe6P =pi1E -----END PGP SIGNATURE----- --6lXr1rPCNTf1w0X8--