Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936090AbXLTPe7 (ORCPT ); Thu, 20 Dec 2007 10:34:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S934112AbXLTPWP (ORCPT ); Thu, 20 Dec 2007 10:22:15 -0500 Received: from mtagate3.de.ibm.com ([195.212.29.152]:44547 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933447AbXLTPVN (ORCPT ); Thu, 20 Dec 2007 10:21:13 -0500 Message-Id: <20071220152111.370679364@de.ibm.com> References: <20071220151925.405881218@de.ibm.com> User-Agent: quilt/0.46-1 Date: Thu, 20 Dec 2007 16:20:03 +0100 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Christian Borntraeger , Martin Schwidefsky Subject: [patch 38/47] vmemmap: allocate struct pages before 1:1 mapping Content-Disposition: inline; filename=137-vmalloc.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1596 Lines: 49 From: Christian Borntraeger We have seen an oops in an OOM situation, where show_mem tried to access the struct page of a dcss segment. The vmemmap code has already created the 1:1 mapping but failed allocating the struct pages. In the OOM case, show_mem now walks the memory. It uses pfn_valid to detect if it may access the struct page. In the case described above, the mapping was established and pfn_valid returned true. As the struct pages were not allocated, the kernel oopsed. We have to ensure that we have created the struct pages, before we add a mapping pointing to the pages. Signed-off-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/mm/vmem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: quilt-2.6/arch/s390/mm/vmem.c =================================================================== --- quilt-2.6.orig/arch/s390/mm/vmem.c +++ quilt-2.6/arch/s390/mm/vmem.c @@ -236,10 +236,10 @@ static int vmem_add_mem(unsigned long st { int ret; - ret = vmem_add_range(start, size); + ret = vmem_add_mem_map(start, size); if (ret) return ret; - return vmem_add_mem_map(start, size); + return vmem_add_range(start, size); } /* -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- 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/