diff options
author | jeff <jeff@FreeBSD.org> | 2002-07-06 07:00:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2002-07-06 07:00:01 +0000 |
commit | 427f5f38922275a7bb218d1406eb9e0cb589eccf (patch) | |
tree | 85e4e496d113cb252366300989c7f835842a160a /sys/kern/kern_exec.c | |
parent | 68e01986120fe7577fe96c40f9eaaff18f1ee461 (diff) | |
download | FreeBSD-src-427f5f38922275a7bb218d1406eb9e0cb589eccf.zip FreeBSD-src-427f5f38922275a7bb218d1406eb9e0cb589eccf.tar.gz |
Clean up execve locking:
- Grab the vnode object early in exec when we still have the vnode lock.
- Cache the object in the image_params.
- Make use of the cached object in imgact_*.c
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r-- | sys/kern/kern_exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index a533d86..8682d62 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -182,6 +182,7 @@ execve(td, uap) imgp->interpreter_name[0] = '\0'; imgp->auxargs = NULL; imgp->vp = NULL; + imgp->object = NULL; imgp->firstpage = NULL; imgp->ps_strings = 0; imgp->auxarg_size = 0; @@ -227,6 +228,8 @@ interpret: VOP_UNLOCK(imgp->vp, 0, td); goto exec_fail_dealloc; } + VOP_GETVOBJECT(imgp->vp, &imgp->object); + vm_object_reference(imgp->object); error = exec_map_first_page(imgp); VOP_UNLOCK(imgp->vp, 0, td); @@ -270,6 +273,8 @@ interpret: /* free name buffer and old vnode */ NDFREE(ndp, NDF_ONLY_PNBUF); vrele(ndp->ni_vp); + vm_object_deallocate(imgp->object); + imgp->object = NULL; /* set new name to that of the interpreter */ NDINIT(ndp, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, imgp->interpreter_name, td); @@ -519,6 +524,9 @@ exec_fail_dealloc: vrele(imgp->vp); } + if (imgp->object) + vm_object_deallocate(imgp->object); + if (error == 0) goto done2; |