PERFORCE change 107691 for review

Todd Miller millert at FreeBSD.org
Wed Oct 11 10:44:51 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=107691

Change 107691 by millert at millert_macbook on 2006/10/11 17:26:17

	Move block of code so that labeling is only performed in
	the non error code path and while the vnode is protected
	by an IO reference (v_iocount).

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_subr.c#6 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/vfs/vfs_subr.c#6 (text+ko) ====

@@ -3400,19 +3400,6 @@
 				vnode_unlock(vp);
 			return(ENOENT);
 		}
-#ifdef MAC
-		if (vnode_mount(vp) != NULL &&
-		    vfs_flags(vnode_mount(vp)) & MNT_MULTILABEL) {
-			int error;
-
-			error = vnode_label1(vp);
-			if (error) {
-				if (!locked)
-					vnode_unlock(vp);
-				return (error);
-			}
-		}
-#endif
 		/*
 		 * will return VL_DEAD ones
 		 */
@@ -3452,6 +3439,20 @@
 		vnode_list_remove(vp);
 	}
 	vp->v_iocount++;
+#ifdef MAC
+	if (vnode_mount(vp) != NULL &&
+	    vfs_flags(vnode_mount(vp)) & MNT_MULTILABEL) {
+		int error;
+
+		error = vnode_label1(vp);
+		if (error) {
+			vp->v_iocount--;
+			if (!locked)
+				vnode_unlock(vp);
+			return (error);
+		}
+	}
+#endif
 #ifdef JOE_DEBUG
 	record_vp(vp, 1);
 #endif


More information about the trustedbsd-cvs mailing list