From owner-svn-src-all@FreeBSD.ORG Wed Sep 3 07:16:37 2014 Return-Path: Delivered-To: svn-src-all@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 24D96EFB; Wed, 3 Sep 2014 07:16:37 +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 B7037199E; Wed, 3 Sep 2014 07:16:36 +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 s837GUeS014627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Sep 2014 10:16:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua s837GUeS014627 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s837GTnE014626; Wed, 3 Sep 2014 10:16:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 3 Sep 2014 10:16:29 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r270993 - head/sys/kern Message-ID: <20140903071629.GG2737@kib.kiev.ua> References: <201409030625.s836PZHY032159@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ycwUkriSLVNn2GEA" Content-Disposition: inline In-Reply-To: <201409030625.s836PZHY032159@svn.freebsd.org> 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: 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.18-1 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: Wed, 03 Sep 2014 07:16:37 -0000 --ycwUkriSLVNn2GEA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 03, 2014 at 06:25:35AM +0000, Mateusz Guzik wrote: > Author: mjg > Date: Wed Sep 3 06:25:34 2014 > New Revision: 270993 > URL: http://svnweb.freebsd.org/changeset/base/270993 >=20 > Log: > Fix up proc_realparent to always return correct process. > =20 > Prior to the change it would always return initproc for non-traced proc= esses. > =20 > This fixes ps apparently always returning 1 as ppid. > =20 > Pointy hat: mjg No, this is my bug. Thank you for fixing it. It is a consequence of the last minute 'safety' change I did. > Reported by: many > MFC after: 1 week I suggest to merge in 3 days. >=20 > Modified: > head/sys/kern/kern_exit.c >=20 > Modified: head/sys/kern/kern_exit.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_exit.c Wed Sep 3 05:14:50 2014 (r270992) > +++ head/sys/kern/kern_exit.c Wed Sep 3 06:25:34 2014 (r270993) > @@ -104,8 +104,12 @@ proc_realparent(struct proc *child) > =20 > sx_assert(&proctree_lock, SX_LOCKED); > if ((child->p_treeflag & P_TREE_ORPHANED) =3D=3D 0) { > - return (child->p_pptr->p_pid =3D=3D child->p_oppid ? > - child->p_pptr : initproc); > + if (child->p_oppid =3D=3D 0 || > + child->p_pptr->p_pid =3D=3D child->p_oppid) > + parent =3D child->p_pptr; > + else > + parent =3D initproc; > + return (parent); > } > for (p =3D child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) =3D=3D 0;) { > /* Cannot use LIST_PREV(), since the list head is not known. */ --ycwUkriSLVNn2GEA Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUBsBNAAoJEJDCuSvBvK1BZsYQAKMG6eByajEpv3jfq4zesfOR n6IrBo6JWXfIGKgyh/Jfz83beKwWwGWj3QW767zCZeTGtUW/zSsgZD2ntTMchPVg phYuOmeKSFYg0qLwauISHuCloWDCDLXSQ3Ytlq5UQ93nHvsuBSrI1Y91Gl/ZiEAt Tz6e4Uz9Hs4aS0TffGMLSKDmDk2vIEPRCxIpVy9TxBHdZMyPxEt8txPzXp8pgOlR X0N9cHCESjYIcTeDJ/0ZOW2dH5NAFLtW4ppAEQll9+ptdcbwHExRh/KOTtkesqf7 1LM2EEYOVC48xDD5QP3omZ6IiMTUzX/wFBU8Ce7ju62R+XTIqqxLskRtIZxRA9hc JAFL/eRjJ3Rn/Dm01u7pmKCF8g+ajCe7jR/wdHm3LAFfcjWDAmrjuNiJWQI75HcX Ky0JLo/paw+9NgDOrNmpo5ZpS77VoS7ZKkPAro9zQSPE6HCzcNdduKiqI9r6NmjJ VTRvHUlMcUK9X7gcKQp+rmZAP+xb7OZep0AdIwERUNmzk5Om9vbu8AjLtfkpMGO4 X2VyGgpDLraVHghtLZ4Vj0c5c/wr159cVLB/sPn2fQUX0skAwP15pdyQx3lmmoX/ /oWQhmc4DWMaEEYvtEYxCty7oAkUNPP42RDgaOpNIVwA5XGI2b+Vv95M1ySvznLd lE/ZCMRbYQQl6FQeeGpO =aWPA -----END PGP SIGNATURE----- --ycwUkriSLVNn2GEA--