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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to