PERFORCE change 167181 for review

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Aug 10 17:59:08 UTC 2009


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

Change 167181 by trasz at trasz_anger on 2009/08/10 17:59:04

	Make 'sig*' actions work.

Affected files ...

.. //depot/projects/soc2009/trasz_limits/TODO#10 edit
.. //depot/projects/soc2009/trasz_limits/sys/kern/kern_hrl.c#52 edit

Differences ...

==== //depot/projects/soc2009/trasz_limits/TODO#10 (text+ko) ====

@@ -17,6 +17,10 @@
 
  - Some things need to be accounted for per-euid, and some per-egid.  Geez.
 
+ - In maxproc limit, make sure the 'p' argument is a child process.  Otherwise,
+   if one adds rule with 'sig*' action, the signal will be sent to the parent
+   instead of the child.
+
  - Add sorting to hrl(8).
 
  - Use expand_number(3) in hrl(8).

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

@@ -233,10 +233,19 @@
 static void
 hrl_deferred_psignal(struct proc *p, int signum)
 {
+	int need_lock;
+
+	/*
+	 * XXX: This is ugly.  Either turn it into a real taskqueue,
+	 *      or think about the locking and don't lock proc here.
+	 */
+	need_lock = !PROC_LOCKED(p);
 
-	PROC_LOCK(p);
+	if (need_lock)
+		PROC_LOCK(p);
 	psignal(p, signum);
-	PROC_UNLOCK(p);
+	if (need_lock)
+		PROC_UNLOCK(p);
 }
 
 /*


More information about the p4-projects mailing list