fasttrap_fork(): unlock the processes before removing the tracepoints.

In the future, we'll need to come up with new proc_*() functions that accept
locked processes. For now, this prevents postgresql + DTrace from crashing the
system.

MFC after:	1 month
This commit is contained in:
Rui Paulo 2013-08-11 00:57:01 +00:00
parent f6ddb56a60
commit e009490afc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=254198

View File

@ -502,7 +502,13 @@ fasttrap_fork(proc_t *p, proc_t *cp)
sprlock_proc(cp);
mtx_unlock_spin(&cp->p_slock);
#else
/*
* fasttrap_tracepoint_remove() expects the child process to be
* unlocked and the VM then expects curproc to be unlocked.
*/
_PHOLD(cp);
PROC_UNLOCK(cp);
PROC_UNLOCK(p);
#endif
/*
@ -537,6 +543,8 @@ fasttrap_fork(proc_t *p, proc_t *cp)
mutex_enter(&cp->p_lock);
sprunlock(cp);
#else
PROC_LOCK(p);
PROC_LOCK(cp);
_PRELE(cp);
#endif
}