Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2014 11:21:39 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Mateusz Guzik <mjguzik@gmail.com>
Cc:        src-committers@freebsd.org, John Baldwin <jhb@freebsd.org>, Mateusz Guzik <mjg@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org, John-Mark Gurney <jmg@funkthat.com>
Subject:   Re: svn commit: r270444 - in head/sys: kern sys
Message-ID:  <20140828082139.GK2737@kib.kiev.ua>
In-Reply-To: <20140828033009.GA29429@dft-labs.eu>
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>

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

--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--



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