Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jan 2007 22:28:19 GMT
From:      Todd Miller <millert@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 113272 for review
Message-ID:  <200701212228.l0LMSJTR060540@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=113272

Change 113272 by millert@millert_macbook on 2007/01/21 22:27:59

	Move the mac_system_check_acct() call before the vnode_put()
	so we don't have to do out own vnode locking.  Brings the
	code more in line with FreeBSD.

Affected files ...

.. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/kern_descrip.c#10 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/bsd/kern/kern_descrip.c#10 (text+ko) ====

@@ -1926,6 +1926,15 @@
 		tablefull("file");
 		return (ENFILE);
 	}
+#ifdef MAC
+	error = mac_file_check_create(proc_ucred(p));
+	if (error) {
+		if (!locked)
+			proc_fdunlock(p);
+		return (error);
+	}
+#endif
+
 	/*
 	 * Allocate a new file descriptor.
 	 * If the process has file descriptor zero open, add to the list
@@ -1934,12 +1943,6 @@
 	 */
 	proc_fdunlock(p);
 
-#ifdef MAC
-	error = mac_file_check_create(proc_ucred(p));
-	if (error)
-		return (error);
-#endif
-
 	MALLOC_ZONE(fp, struct fileproc *, sizeof(struct fileproc), M_FILEPROC, M_WAITOK);
 	MALLOC_ZONE(fg, struct fileglob *, sizeof(struct fileglob), M_FILEGLOB, M_WAITOK);
 	bzero(fp, sizeof(struct fileproc));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701212228.l0LMSJTR060540>