Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Dec 2010 11:55:55 GMT
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 187053 for review
Message-ID:  <201012191155.oBJBttxd007348@skunkworks.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@187053?ac=10

Change 187053 by trasz@trasz_victim on 2010/12/19 11:55:55

	Fix rusage_proc_fork() failure handling.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_fork.c#29 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/sys/kern/kern_fork.c#29 (text+ko) ====

@@ -772,6 +772,21 @@
 	knlist_init_mtx(&newproc->p_klist, &newproc->p_mtx);
 	STAILQ_INIT(&newproc->p_ktr);
 
+	/*
+	 * XXX: This is ugly; when we copy resource usage, we need to bump
+	 *      per-cred resource counters.
+	 */
+	newproc->p_ucred = p1->p_ucred;
+
+	/*
+	 * Initialize resource container for the child process.
+	 */
+	error = container_proc_fork(p1, newproc);
+	if (error != 0) {
+		error = EAGAIN;
+		goto fail1;
+	}
+
 	/* We have to lock the process tree while we look for a pid. */
 	sx_slock(&proctree_lock);
 
@@ -790,20 +805,6 @@
 	}
 
 	/*
-	 * XXX: This is ugly; when we copy resource usage, we need to bump
-	 *      per-cred resource counters.
-	 */
-	newproc->p_ucred = p1->p_ucred;
-
-	/*
-	 * Initialize resource container for the child process.
-	 */
-	error = container_proc_fork(p1, newproc);
-	if (error != 0) {
-		error = EAGAIN;
-		goto fail;
-	}
-	/*
 	 * After fork, there is exactly one thread running.
 	 */
 	error = rusage_set(newproc, RUSAGE_NTHR, 1);



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