From owner-svn-src-head@FreeBSD.ORG Thu Aug 28 08:21:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58B60755; Thu, 28 Aug 2014 08:21:46 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAB831186; Thu, 28 Aug 2014 08:21:45 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s7S8LdDN031144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 28 Aug 2014 11:21:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s7S8LdDN031144 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s7S8LdX0031143; Thu, 28 Aug 2014 11:21:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Aug 2014 11:21:39 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r270444 - in head/sys: kern sys Message-ID: <20140828082139.GK2737@kib.kiev.ua> References: <201408240904.s7O949sI083660@svn.freebsd.org> <201408261509.26815.jhb@freebsd.org> <20140826193210.GL71691@funkthat.com> <201408261723.10854.jhb@freebsd.org> <20140826215522.GG2737@kib.kiev.ua> <20140827165432.GA28581@dft-labs.eu> <20140827185903.GJ2737@kib.kiev.ua> <20140828033009.GA29429@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3zkUw7Z/8N7C7PXP" Content-Disposition: inline In-Reply-To: <20140828033009.GA29429@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: src-committers@freebsd.org, John Baldwin , Mateusz Guzik , svn-src-all@freebsd.org, svn-src-head@freebsd.org, John-Mark Gurney X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 28 Aug 2014 08:21:46 -0000 --3zkUw7Z/8N7C7PXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 28, 2014 at 05:30:09AM +0200, Mateusz Guzik wrote: > @@ -791,6 +791,8 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_pro= c *kp) > struct ucred *cred; > struct sigacts *ps; > =20 > + /* For proc_realparent. */ > + sx_assert(&proctree_lock, SX_LOCKED); > PROC_LOCK_ASSERT(p, MA_OWNED); > bzero(kp, sizeof(*kp)); > =20 > @@ -920,7 +922,9 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_pro= c *kp) > kp->ki_acflag =3D p->p_acflag; > kp->ki_lock =3D p->p_lock; > if (p->p_pptr) > - kp->ki_ppid =3D p->p_pptr->p_pid; > + kp->ki_ppid =3D proc_realparent(p)->p_pid; Is the check for p_pptr !=3D NULL still needed for the call to proc_realparent() ? If yes, I think it indicates a bug in proc_realparent(), which should incorporate the check, instead of enforcing it on the callers. It seems to be there for the kernel process (pid 0). If the test can be removed, and proc_realparent() called unconditionally, I suggest to remove assert about proctree_lock at the start of fill_kinfo_proc_only(), since the check is done in proc_realparent(). Whatever decision is made there, it can be implemented after your change is landed. The patch looks fine for me. --3zkUw7Z/8N7C7PXP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJT/uaSAAoJEJDCuSvBvK1BF+EP/02xcc43PmiKXHi2e3Y19Rj5 ExP+++pBMFCVh9EGZlKuEEOFatneiPhnpR1fDUY6C7zSMkZe/+fOIMP6pYifNnUw cLWF3Vfw+1B8x1Z7L6QksqJYE7QWhutzMl2Kbh0h0Ez5x9aw6yK5oW7/NkNLHjD4 qF8MxDqasiYixF3GEtAtIEUm5PyWc75CjeU2ozdRgmUqFRrYOeJUYAcZUFToi3N/ ls+wHsMjX8J8iwVqgPkesDlfn8nqF3+Wma4P4OEUQQnu/2cYfaTg1l5JEKwuEKvY dOFYFfqRODnlXEKvVyVbQRH2nxvyTAovIMnW6lr+DXJX6QIlda9cE9BN6NtoBgSK RMgDnnPjxfL33TC53tZvtht4BSg5692WC1bgZ7Gkpv+9MnQ2LKIV1ppmIg2QcFIP tjYvX5ThtM++e4yAAtopMSTobDy1uYdFokOnHny5Lwy7hBSNP2XKfoEU3VdLbj0w CYwj3jB7KAc8N5oPSIL7mPJNdnknTmO8UdxqEROJ7vyShCZTNz+Ssa+3zRpnMUY7 V5EARl/mVSbirHtb8rWeGEsl/D8GhNE14HqGVmCS9DpffV9vAFxYBQyDCxIBWmIL 353mV9yniaaEF2J/2ZZZXmvifYt80VSJLvhQFV7CnwZwxauQ3sNvbbTuXisI1jjC 94Zl4U7Jv3jBUGKKrGhx =nzs4 -----END PGP SIGNATURE----- --3zkUw7Z/8N7C7PXP--