diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2008-01-26 08:11:16 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:11:23 -0500 |
commit | a2fd64d6aaf498756f700eb1d07818efee046733 (patch) | |
tree | f89c7119bcb00826a7ed99b14d2bbe7d2edcc043 /arch/s390/mm/vmem.c | |
parent | d09293aee9fd0f9f291fa3a0e4ca5012f514d083 (diff) |
[S390] vmemmap: allocate struct pages before 1:1 mapping
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 <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/vmem.c')
-rw-r--r-- | arch/s390/mm/vmem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 1fc99891c4eb..79d13a166a3d 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c | |||
@@ -236,10 +236,10 @@ static int vmem_add_mem(unsigned long start, unsigned long size) | |||
236 | { | 236 | { |
237 | int ret; | 237 | int ret; |
238 | 238 | ||
239 | ret = vmem_add_range(start, size); | 239 | ret = vmem_add_mem_map(start, size); |
240 | if (ret) | 240 | if (ret) |
241 | return ret; | 241 | return ret; |
242 | return vmem_add_mem_map(start, size); | 242 | return vmem_add_range(start, size); |
243 | } | 243 | } |
244 | 244 | ||
245 | /* | 245 | /* |