Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2012 15:26:24 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237073 - head/sys/kern
Message-ID:  <201206141526.q5EFQOCR002506@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Thu Jun 14 15:26:23 2012
New Revision: 237073
URL: http://svn.freebsd.org/changeset/base/237073

Log:
  Assert that the filedesc lock is not held when closef() is called.
  
  MFC after:	1 month

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Thu Jun 14 15:24:45 2012	(r237072)
+++ head/sys/kern/kern_descrip.c	Thu Jun 14 15:26:23 2012	(r237073)
@@ -2112,6 +2112,9 @@ closef(struct file *fp, struct thread *t
 	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 *t
 			 * 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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206141526.q5EFQOCR002506>