Hi, all,
I'll do some small modifications on this patch and will
send out a v3 version later. Because:
1.some boudary conditions need to be adjusted and 
2.the page frame  validation code will be moved to the
place where  Joey once put in his patch(which would 
look more reasonable)
Please refer to detail below:
Thanks!
:
> -----Original Message-----
> From: Chen, Yu C
> Sent: Tuesday, September 01, 2015 6:04 PM
> To: [email protected]; Brown, Len; [email protected]
> Cc: [email protected]; [email protected]; [email protected]; linux-
> [email protected]; [email protected]; Chen, Yu C
> Subject: [PATCH] [v2] PM / hibernate: Fix hibernation panic caused by
> inconsistent e820 map
> 
> +static void mark_valid_pages(struct memory_bitmap *bm) {
> +     unsigned long start_pfn, end_pfn;
> +     int i, j;
> +
> +     for (i = 0; i < nr_pfn_mapped; i++) {
> +             start_pfn = pfn_mapped[i].start;
> +             end_pfn = pfn_mapped[i].end;
> +             for (j = start_pfn; j <= end_pfn; j++)

Changed j <= end_pfn to j < end_pfn

> -2427,11 +2526,19 @@ static void *get_buffer(struct memory_bitmap *bm,
> -     if (swsusp_page_is_forbidden(page) &&
> swsusp_page_is_free(page))
> +     if (swsusp_page_is_forbidden(page) &&
> swsusp_page_is_free(page)) {
> -             return page_address(page);
> +             if (is_valid_orig_page(pfn))
Moved to mark_unsafe_pages
> +                     return page_address(page);
> +             else
> +                     return ERR_PTR(-EFAULT);
> +     }


Best Regards,
Yu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to