Merge tag 'v3.10.97' into update
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / signal.c
index 4d1f7fa3138db1a649cd610806b45528b1cca24c..0991539b3394b1ec099a7b56e2ef1faa5c42bfa3 100644 (file)
@@ -861,8 +861,10 @@ static bool prepare_signal(int sig, struct task_struct *p, bool force)
        struct task_struct *t;
 
        if (signal->flags & (SIGNAL_GROUP_EXIT | SIGNAL_GROUP_COREDUMP)) {
-               if (signal->flags & SIGNAL_GROUP_COREDUMP)
-                       return sig == SIGKILL;
+               if (signal->flags & SIGNAL_GROUP_COREDUMP) {
+                       printk(KERN_DEBUG "[%d:%s] is in the middle of dying so skip sig %d\n",p->pid, p->comm, sig);
+               }
+               return 0;
                /*
                 * The process is in the middle of dying, nothing to do.
                 */
@@ -1043,6 +1045,8 @@ static inline void userns_fixup_signal_uid(struct siginfo *info, struct task_str
 }
 #endif
 
+static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
+
 static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
                        int group, int from_ancestor_ns)
 {
@@ -1050,7 +1054,12 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
        struct sigqueue *q;
        int override_rlimit;
        int ret = 0, result;
+       unsigned state;
 
+       state = t->state ? __ffs(t->state) + 1 : 0;
+       printk(KERN_DEBUG "[%d:%s] sig %d to [%d:%s] stat=%c\n",
+              current->pid, current->comm, sig, t->pid, t->comm,
+              state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
        assert_spin_locked(&t->sighand->siglock);
 
        result = TRACE_SIGNAL_IGNORED;
@@ -2849,7 +2858,7 @@ int do_sigtimedwait(const sigset_t *which, siginfo_t *info,
                recalc_sigpending();
                spin_unlock_irq(&tsk->sighand->siglock);
 
-               timeout = schedule_timeout_interruptible(timeout);
+               timeout = freezable_schedule_timeout_interruptible(timeout);
 
                spin_lock_irq(&tsk->sighand->siglock);
                __set_task_blocked(tsk, &tsk->real_blocked);