提交 cdf4b3fa 编写于 作者: X Xunlei Pang 提交者: Linus Torvalds

kexec: set KEXEC_TYPE_CRASH before sanity_check_segment_list()

sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure all the
segments of the loaded crash kernel are within the kernel crash resource
limits, so set the flag beforehand.
Signed-off-by: NXunlei Pang <xlpang@redhat.com>
Acked-by: NDave Young <dyoung@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Acked-by: NBaoquan He <bhe@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 9425676a
...@@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, ...@@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
if (ret) if (ret)
goto out_free_image; goto out_free_image;
ret = sanity_check_segment_list(image);
if (ret)
goto out_free_image;
/* Enable the special crash kernel control page allocation policy. */
if (kexec_on_panic) { if (kexec_on_panic) {
/* Enable special crash kernel control page alloc policy. */
image->control_page = crashk_res.start; image->control_page = crashk_res.start;
image->type = KEXEC_TYPE_CRASH; image->type = KEXEC_TYPE_CRASH;
} }
ret = sanity_check_segment_list(image);
if (ret)
goto out_free_image;
/* /*
* Find a location for the control code buffer, and add it * Find a location for the control code buffer, and add it
* the vector of segments so that it's pages will also be * the vector of segments so that it's pages will also be
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册