diff options
author | trasz <trasz@FreeBSD.org> | 2011-07-06 20:06:44 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2011-07-06 20:06:44 +0000 |
commit | 4a17b24427e55ec7e1862b08a0a9247f0717d010 (patch) | |
tree | 443d8da9aef22fdf042ab6f2cf16f5e2d4f04bd3 /sys/kern/imgact_elf.c | |
parent | 1adac93bc0e2f40ac5d98734f9451cb1a0f42124 (diff) | |
download | FreeBSD-src-4a17b24427e55ec7e1862b08a0a9247f0717d010.zip FreeBSD-src-4a17b24427e55ec7e1862b08a0a9247f0717d010.tar.gz |
All the racct_*() calls need to happen with the proc locked. Fixing this
won't happen before 9.0. This commit adds "#ifdef RACCT" around all the
"PROC_LOCK(p); racct_whatever(p, ...); PROC_UNLOCK(p)" instances, in order
to avoid useless locking/unlocking in kernels built without "options RACCT".
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index ad79360..45f6d64 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1115,6 +1115,7 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) hdrsize = 0; __elfN(puthdr)(td, (void *)NULL, &hdrsize, seginfo.count); +#ifdef RACCT PROC_LOCK(td->td_proc); error = racct_add(td->td_proc, RACCT_CORE, hdrsize + seginfo.size); PROC_UNLOCK(td->td_proc); @@ -1122,6 +1123,7 @@ __elfN(coredump)(struct thread *td, struct vnode *vp, off_t limit, int flags) error = EFAULT; goto done; } +#endif if (hdrsize + seginfo.size >= limit) { error = EFAULT; goto done; |