lkml.org 
[lkml]   [2010]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Fix OOPS in crash_kernel_shrink
Vitaly Mayatskikh wrote:
> Two "echo 0 > /sys/kernel/kexec_crash_size" OOPSes kernel. Also
> content of this file is invalid after first shrink to zero: it shows 1
> instead of 0.
>
> This patch fixes it.

Hmmm, I certainly did tests for 'echo 0 > kexec_crash_size' when I
worked on this, but I didn't get any oops. Can you show me the full
oops?

But yes, the size calculation looks wrong.

>
> Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
>
> diff --git a/kernel/kexec.c b/kernel/kexec.c
> index 87ebe8a..474a847 100644
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -1134,11 +1134,9 @@ int crash_shrink_memory(unsigned long new_size)
>
> free_reserved_phys_range(end, crashk_res.end);
>
> - if (start == end) {
> - crashk_res.end = end;
> + if (start == end)
> release_resource(&crashk_res);
> - } else
> - crashk_res.end = end - 1;
> + crashk_res.end = end - 1;
>

If we do this, crashk_res.end will be ahead of crashk.start.

Thanks.


\
 
 \ /
  Last update: 2010-04-20 14:55    [W:0.285 / U:0.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site