svn commit: r237204 - head/sys/kern

Pawel Jakub Dawidek pjd at FreeBSD.org
Sun Jun 17 21:04:23 UTC 2012


Author: pjd
Date: Sun Jun 17 21:04:22 2012
New Revision: 237204
URL: http://svn.freebsd.org/changeset/base/237204

Log:
  Don't check for race with close on advisory unlock (there is nothing smart we
  can do when such a race occurs). This saves lock/unlock cycle for the filedesc
  lock for every advisory unlock operation.
  
  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 21:02:48 2012	(r237203)
+++ head/sys/kern/kern_descrip.c	Sun Jun 17 21:04:22 2012	(r237204)
@@ -668,7 +668,8 @@ kern_fcntl(struct thread *td, int fd, in
 		}
 		VFS_UNLOCK_GIANT(vfslocked);
 		vfslocked = 0;
-		if (error != 0) {
+		if (error != 0 || flp->l_type == F_UNLCK ||
+		    flp->l_type == F_UNLCKSYS) {
 			fdrop(fp, td);
 			break;
 		}


More information about the svn-src-all mailing list