svn commit: r237198 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Jun 17 16:32:33 UTC 2012


Author: pjd
Date: Sun Jun 17 16:32:32 2012
New Revision: 237198
URL: http://svn.freebsd.org/changeset/base/237198

Log:
  If VOP_ADVLOCK() call or earlier checks failed don't check for a race with
  close, because even if we had a race there is nothing to unlock.
  
  Discussed with:	kib
  MFC after:	1 month

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Sun Jun 17 16:19:09 2012	(r237197)
+++ head/sys/kern/kern_descrip.c	Sun Jun 17 16:32:32 2012	(r237198)
@@ -668,6 +668,10 @@ kern_fcntl(struct thread *td, int fd, in
 		}
 		VFS_UNLOCK_GIANT(vfslocked);
 		vfslocked = 0;
+		if (error != 0) {
+			fdrop(fp, td);
+			break;
+		}
 		/* Check for race with close */
 		FILEDESC_SLOCK(fdp);
 		if (fget_locked(fdp, fd) != fp) {


More information about the svn-src-all mailing list