mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][Fix] Hibernation: Do not try to mark invalid PFNs as nosave
@ 2007-08-02 17:18 Rafael J. Wysocki
  2007-08-02 17:55 ` Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2007-08-02 17:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Pavel Machek, pm list, Thomas Renninger

[Please consider as 2.6.23 material.]
---
From: Rafael J. Wysocki <rjw@sisk.pl>

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>
---
 kernel/power/snapshot.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/kernel/power/snapshot.c
===================================================================
--- linux-2.6.orig/kernel/power/snapshot.c
+++ linux-2.6/kernel/power/snapshot.c
@@ -709,7 +709,8 @@ static void mark_nosave_pages(struct mem
 				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);
 	}
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-02 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-02 17:18 [PATCH][Fix] Hibernation: Do not try to mark invalid PFNs as nosave Rafael J. Wysocki
2007-08-02 17:55 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®