diff options
author | pjd <pjd@FreeBSD.org> | 2012-06-14 15:26:23 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2012-06-14 15:26:23 +0000 |
commit | 32b7d4b1494f830b495e37e72fe31be77bef62b6 (patch) | |
tree | 59ad4b4f2a9c26824401dfefb2cb22b9f5a4de49 /sys/kern/kern_descrip.c | |
parent | e5880d5fb5cce0232295b528d1e0b98080c054af (diff) | |
download | FreeBSD-src-32b7d4b1494f830b495e37e72fe31be77bef62b6.zip FreeBSD-src-32b7d4b1494f830b495e37e72fe31be77bef62b6.tar.gz |
Assert that the filedesc lock is not held when closef() is called.
MFC after: 1 month
Diffstat (limited to 'sys/kern/kern_descrip.c')
-rw-r--r-- | sys/kern/kern_descrip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index f2a43b7..6802672 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2112,6 +2112,9 @@ closef(struct file *fp, struct thread *td) struct filedesc *fdp; struct file *fp_object; + fdp = td->td_proc->p_fd; + FILEDESC_UNLOCK_ASSERT(fdp); + /* * POSIX record locking dictates that any close releases ALL * locks owned by this process. This is handled by setting @@ -2147,7 +2150,6 @@ closef(struct file *fp, struct thread *td) * Handle special case where file descriptor table is * shared between multiple process leaders. */ - fdp = td->td_proc->p_fd; FILEDESC_XLOCK(fdp); for (fdtol = fdtol->fdl_next; fdtol != td->td_proc->p_fdtol; |