aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2012-05-10 04:47:21 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-05-16 08:42:43 -0400
commitd49f47f83d15f3142d482a29de76f45360e34082 (patch)
tree255724f1f3d0e6b395c14ca91829ed6141be7964 /arch/s390/mm
parent0a16ba7866fd5cd802d49801a099f4c558ce99c7 (diff)
s390/pfault: add sanity check
If the task that was found on an initial interrupt doesn't match the current task execute a WARN_ON_ONCE() and don't put the task to sleep. When this happened something went wrong between the interface of the hypervisor and the kernel. In such a case keep the tasks alive to avoid a hanging system. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/fault.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index a9c11aa57450..72cec9ecd96c 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -584,6 +584,8 @@ static void pfault_interrupt(struct ext_code ext_code,
584 } 584 }
585 } else { 585 } else {
586 /* signal bit not set -> a real page is missing. */ 586 /* signal bit not set -> a real page is missing. */
587 if (WARN_ON_ONCE(tsk != current))
588 goto out;
587 if (tsk->thread.pfault_wait == 1) { 589 if (tsk->thread.pfault_wait == 1) {
588 /* Already on the list with a reference: put to sleep */ 590 /* Already on the list with a reference: put to sleep */
589 __set_task_state(tsk, TASK_UNINTERRUPTIBLE); 591 __set_task_state(tsk, TASK_UNINTERRUPTIBLE);
@@ -606,6 +608,7 @@ static void pfault_interrupt(struct ext_code ext_code,
606 set_tsk_need_resched(tsk); 608 set_tsk_need_resched(tsk);
607 } 609 }
608 } 610 }
611out:
609 spin_unlock(&pfault_lock); 612 spin_unlock(&pfault_lock);
610 put_task_struct(tsk); 613 put_task_struct(tsk);
611} 614}