Date: Mon, 3 Oct 2011 15:32:15 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r225938 - head/sys/kern Message-ID: <201110031532.p93FWF5C016240@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Mon Oct 3 15:32:15 2011 New Revision: 225938 URL: http://svn.freebsd.org/changeset/base/225938 Log: Fix bug introduced in r225641, which would cause panic if racct_proc_fork() returned error -- the racct_destroy_locked() would get called twice. MFC after: 3 days Modified: head/sys/kern/kern_racct.c Modified: head/sys/kern/kern_racct.c ============================================================================== --- head/sys/kern/kern_racct.c Mon Oct 3 15:13:09 2011 (r225937) +++ head/sys/kern/kern_racct.c Mon Oct 3 15:32:15 2011 (r225938) @@ -569,32 +569,15 @@ racct_proc_fork(struct proc *parent, str error = racct_set_locked(child, i, parent->p_racct->r_resources[i]); - if (error != 0) { - /* - * XXX: The only purpose of these two lines is - * to prevent from tripping checks in racct_destroy(). - */ - for (i = 0; i <= RACCT_MAX; i++) - racct_set_locked(child, i, 0); + if (error != 0) goto out; - } } #ifdef RCTL error = rctl_proc_fork(parent, child); - if (error != 0) { - /* - * XXX: The only purpose of these two lines is to prevent from - * tripping checks in racct_destroy(). - */ - for (i = 0; i <= RACCT_MAX; i++) - racct_set_locked(child, i, 0); - } #endif out: - if (error != 0) - racct_destroy_locked(&child->p_racct); mtx_unlock(&racct_lock); PROC_UNLOCK(child); PROC_UNLOCK(parent);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110031532.p93FWF5C016240>