git: 49db81aa053b - main - kern_procctl: skip zombies for process group operations
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 19 Oct 2021 20:04:55 UTC
The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=49db81aa053beb131ba9dbf5519a5f0eacf28265 commit 49db81aa053beb131ba9dbf5519a5f0eacf28265 Author: Konstantin Belousov <kib@FreeBSD.org> AuthorDate: 2021-10-18 21:29:01 +0000 Commit: Konstantin Belousov <kib@FreeBSD.org> CommitDate: 2021-10-19 20:04:34 +0000 kern_procctl: skip zombies for process group operations When iterating over the process group members, skip zombies same as it is done by pfind() for single-process operation. Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32513 --- sys/kern/kern_procctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 890a2e05bb27..00c68359f375 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -960,8 +960,10 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) first_error = 0; LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || (cmd_info->need_candebug ? - p_candebug(td, p) : p_cansee(td, p)) != 0) { + if (p->p_state == PRS_NEW || + p->p_state == PRS_ZOMBIE || + (cmd_info->need_candebug ? p_candebug(td, p) : + p_cansee(td, p)) != 0) { PROC_UNLOCK(p); continue; }