vmscan: count the number of times zone_reclaim() scans and fails
[sfrench/cifs-2.6.git] / arch / ia64 / ia32 / ia32_signal.c
index 85e82f32e480c4707de98d4fcdb73e801f2ebc95..b763ca19ef173f26a642910124cbf30f30b3ad43 100644 (file)
@@ -463,7 +463,7 @@ sys32_sigsuspend (int history0, int history1, old_sigset_t mask)
 
        current->state = TASK_INTERRUPTIBLE;
        schedule();
-       set_thread_flag(TIF_RESTORE_SIGMASK);
+       set_restore_sigmask();
        return -ERESTARTNOHAND;
 }
 
@@ -766,8 +766,19 @@ get_sigframe (struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
 
        /* This is the X/Open sanctioned signal stack switching.  */
        if (ka->sa.sa_flags & SA_ONSTACK) {
-               if (!on_sig_stack(esp))
+               int onstack = sas_ss_flags(esp);
+
+               if (onstack == 0)
                        esp = current->sas_ss_sp + current->sas_ss_size;
+               else if (onstack == SS_ONSTACK) {
+                       /*
+                        * If we are on the alternate signal stack and would
+                        * overflow it, don't. Return an always-bogus address
+                        * instead so we will die with SIGSEGV.
+                        */
+                       if (!likely(on_sig_stack(esp - frame_size)))
+                               return (void __user *) -1L;
+               }
        }
        /* Legacy stack switching not supported */