Skip to content

Commit

Permalink
Hibernation: do not try to mark invalid PFNs as nosave
Browse files Browse the repository at this point in the history
On some systems some PFNs reported by the early initialization code as
'nosave' may be invalid.  If 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 <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Aug 11, 2007
1 parent a75de1b commit c5a69ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/power/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit c5a69ad

Please sign in to comment.