The "pid" field in the LinuxKPI task struct is typically set to the thread ID
and not the process ID. Make sure the linux_task_exiting() function uses tdfind() to lookup the BSD procedure structure pointer by the "pid" field, and only fallback to pfind() when no match is found! This makes linux_task_exiting() in line with the rest of the code. Differential Revision: https://reviews.freebsd.org/D25509 Submitted by: Greg V <greg@unrelenting.technology> MFC after: 1 week Sponsored by: Mellanox Technologies
This commit is contained in:
parent
5d1c042d32
commit
9a4e535b39
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362829
@ -219,11 +219,21 @@ linux_get_pid_task(pid_t pid)
|
|||||||
bool
|
bool
|
||||||
linux_task_exiting(struct task_struct *task)
|
linux_task_exiting(struct task_struct *task)
|
||||||
{
|
{
|
||||||
|
struct thread *td;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
ret = false;
|
ret = false;
|
||||||
p = pfind(task->pid);
|
|
||||||
|
/* try to find corresponding thread */
|
||||||
|
td = tdfind(task->pid, -1);
|
||||||
|
if (td != NULL) {
|
||||||
|
p = td->td_proc;
|
||||||
|
} else {
|
||||||
|
/* try to find corresponding procedure */
|
||||||
|
p = pfind(task->pid);
|
||||||
|
}
|
||||||
|
|
||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
if ((p->p_flag & P_WEXIT) != 0)
|
if ((p->p_flag & P_WEXIT) != 0)
|
||||||
ret = true;
|
ret = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user