svn commit: r184261 - in stable/6/sys: . kern

Doug Rabson dfr at FreeBSD.org
Sat Oct 25 14:01:08 UTC 2008


Author: dfr
Date: Sat Oct 25 14:01:08 2008
New Revision: 184261
URL: http://svn.freebsd.org/changeset/base/184261

Log:
  MFC: r184227 - don't use *statep without holding the vnode interlock
  
  This change is being merged earlier than originally planned at the request
  of the release engineers.
  
  Approved by:    re (kib)

Modified:
  stable/6/sys/   (props changed)
  stable/6/sys/kern/kern_lockf.c

Modified: stable/6/sys/kern/kern_lockf.c
==============================================================================
--- stable/6/sys/kern/kern_lockf.c	Sat Oct 25 14:00:37 2008	(r184260)
+++ stable/6/sys/kern/kern_lockf.c	Sat Oct 25 14:01:08 2008	(r184261)
@@ -467,12 +467,15 @@ lf_advlockasync(struct vop_advlockasync_
 	/*
 	 * Avoid the common case of unlocking when inode has no locks.
 	 */
-	if ((*statep) == NULL || LIST_EMPTY(&(*statep)->ls_active)) {
+	VI_LOCK(vp);
+	if ((*statep) == NULL) {
 		if (ap->a_op != F_SETLK) {
 			fl->l_type = F_UNLCK;
+			VI_UNLOCK(vp);
 			return (0);
 		}
 	}
+	VI_UNLOCK(vp);
 
 	/*
 	 * Map our arguments to an existing lock owner or create one


More information about the svn-src-stable-6 mailing list