From: Rafael J. Wysocki Date: Wed, 15 Aug 2007 13:37:37 +0000 (+0200) Subject: Hibernation: do not try to mark invalid PFNs as nosave X-Git-Tag: v2.6.22.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91f9aa522baa31a5af4909667487ba163e849c3d;p=thirdparty%2Fkernel%2Fstable.git Hibernation: do not try to mark invalid PFNs as nosave On some systems some PFNs reported by the early initialization code as 'nosave' may be invalid. =A0If we try to set the corresponding bits in the hibernation bitmap, BUG_ON() in memory_bm_find_bit() will be triggered and the system won't be able to boot (cf. https://bugzilla.novell.com/show_bug.cgi?id=296242). Prevent this from happening by verifying if the 'nosave' PFNs are valid in mark_nosave_pages(). Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c index a3b7854b8f7c8..a686590d88c1b 100644 --- a/kernel/power/snapshot.c +++ b/kernel/power/snapshot.c @@ -709,7 +709,8 @@ static void mark_nosave_pages(struct memory_bitmap *bm) region->end_pfn << PAGE_SHIFT); for (pfn = region->start_pfn; pfn < region->end_pfn; pfn++) - memory_bm_set_bit(bm, pfn); + if (pfn_valid(pfn)) + memory_bm_set_bit(bm, pfn); } }