Date: Wed, 3 Sep 2014 10:16:29 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: Mateusz Guzik <mjg@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r270993 - head/sys/kern Message-ID: <20140903071629.GG2737@kib.kiev.ua> In-Reply-To: <201409030625.s836PZHY032159@svn.freebsd.org> References: <201409030625.s836PZHY032159@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140903071629.GG2737>