Skip to content

Commit

Permalink
PM / Hibernate: Modify signature used to mark swap
Browse files Browse the repository at this point in the history
Since we are adding compression to the kernel's hibernate code,
change signature used by it to mark swap spaces, so that earlier
kernels don't attempt to restore compressed images they cannot
handle.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
  • Loading branch information
Rafael J. Wysocki committed Oct 16, 2010
1 parent 71c6312 commit 3624eb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/power/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "power.h"

#define SWSUSP_SIG "S1SUSPEND"
#define HIBERNATE_SIG "LINHIB0001"

/*
* The swap map is a data structure used for keeping track of each page
Expand Down Expand Up @@ -195,7 +195,7 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) ||
!memcmp("SWAPSPACE2",swsusp_header->sig, 10)) {
memcpy(swsusp_header->orig_sig,swsusp_header->sig, 10);
memcpy(swsusp_header->sig,SWSUSP_SIG, 10);
memcpy(swsusp_header->sig, HIBERNATE_SIG, 10);
swsusp_header->image = handle->first_sector;
swsusp_header->flags = flags;
error = hib_bio_write_page(swsusp_resume_block,
Expand Down Expand Up @@ -916,7 +916,7 @@ int swsusp_check(void)
if (error)
goto put;

if (!memcmp(SWSUSP_SIG, swsusp_header->sig, 10)) {
if (!memcmp(HIBERNATE_SIG, swsusp_header->sig, 10)) {
memcpy(swsusp_header->sig, swsusp_header->orig_sig, 10);
/* Reset swap signature now */
error = hib_bio_write_page(swsusp_resume_block,
Expand Down

0 comments on commit 3624eb0

Please sign in to comment.