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) {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to