[patch] sigfix-2.5.40-A0

From: Ingo Molnar (mingo@elte.hu)
Date: Wed Oct 02 2002 - 04:31:36 EST


the attached patch (against BK-curr) fixes yet another thread signal
detail, reported by Axel Zeuner (and also reproduced in Ulrich's thread
signal testcases) - sigwaiting threads do count as if they had those
signals unblocked. Fortunately fixing this means the removal of the
real_blocked field from task_struct.

        Ingo

--- linux/include/linux/sched.h.orig Wed Oct 2 11:22:32 2002
+++ linux/include/linux/sched.h Wed Oct 2 11:23:28 2002
@@ -378,7 +378,7 @@
 /* signal handlers */
         struct signal_struct *sig;
 
- sigset_t blocked, real_blocked, shared_unblocked;
+ sigset_t blocked, shared_unblocked;
         struct sigpending pending;
 
         unsigned long sas_ss_sp;
--- linux/kernel/signal.c.orig Wed Oct 2 11:22:16 2002
+++ linux/kernel/signal.c Wed Oct 2 11:23:22 2002
@@ -843,8 +843,7 @@
         struct pid *pid;
 
         for_each_task_pid(p->tgid, PIDTYPE_TGID, tmp, l, pid)
- if (!sigismember(&tmp->blocked, signr) &&
- !sigismember(&tmp->real_blocked, signr))
+ if (!sigismember(&tmp->blocked, signr))
                         return tmp;
         return NULL;
 }
@@ -1482,7 +1481,8 @@
                         /* None ready -- temporarily unblock those we're
                          * interested while we are sleeping in so that we'll
                          * be awakened when they arrive. */
- current->real_blocked = current->blocked;
+ sigset_t orig_blocked = current->blocked;
+
                         sigandsets(&current->blocked, &current->blocked, &these);
                         recalc_sigpending();
                         spin_unlock_irq(&current->sig->siglock);
@@ -1494,8 +1494,7 @@
                         sig = dequeue_signal(&current->sig->shared_pending, &these, &info);
                         if (!sig)
                                 sig = dequeue_signal(&current->pending, &these, &info);
- current->blocked = current->real_blocked;
- siginitset(&current->real_blocked, 0);
+ current->blocked = orig_blocked;
                         recalc_sigpending();
                 }
         }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:33 EST