Move a vref call outside of proc locks and Giant. By virtue of the fact
that we (p1) are currently running, we hold a reference on p_textvp which means the vnode cannot go away. p2 cannot run yet (and hence cannot exit) so this should be safe to do at this point. As a bonus, it removes a block of under-Giant code that was there to support the vref.
This commit is contained in:
parent
b8f8da5d90
commit
a69d88af52
@ -474,7 +474,6 @@ again:
|
||||
if (pages != 0)
|
||||
vm_thread_new_altkstack(td2, pages);
|
||||
|
||||
mtx_lock(&Giant); /* XXX: for VREF() */
|
||||
PROC_LOCK(p2);
|
||||
PROC_LOCK(p1);
|
||||
|
||||
@ -537,11 +536,7 @@ again:
|
||||
else
|
||||
p2->p_sigparent = SIGCHLD;
|
||||
|
||||
/* Bump references to the text vnode (for procfs) */
|
||||
p2->p_textvp = p1->p_textvp;
|
||||
if (p2->p_textvp)
|
||||
VREF(p2->p_textvp);
|
||||
mtx_unlock(&Giant); /* XXX: for VREF() */
|
||||
p2->p_fd = fd;
|
||||
p2->p_fdtol = fdtol;
|
||||
|
||||
@ -552,6 +547,10 @@ again:
|
||||
PROC_UNLOCK(p1);
|
||||
PROC_UNLOCK(p2);
|
||||
|
||||
/* Bump references to the text vnode (for procfs) */
|
||||
if (p2->p_textvp)
|
||||
vref(p2->p_textvp);
|
||||
|
||||
/*
|
||||
* Set up linkage for kernel based threading.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user