@@ -306,9 +306,12 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
{
int error;
- hib_submit_io(REQ_OP_READ, 0, swsusp_resume_block,
- swsusp_header, NULL);
- if (!memcmp("SWAP-SPACE",swsusp_header->sig, 10) ||
+ error = hib_submit_io(REQ_OP_READ, 0, swsusp_resume_block,
+ swsusp_header, NULL);
+ if (error) {
+ printk(KERN_ERR "PM: Unable to read Swap header, error %d.\n",
+ error);
+ } else 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, HIBERNATE_SIG, 10);
@@ -319,7 +322,8 @@ static int mark_swapfiles(struct swap_map_handle *handle, unsigned int flags)
error = hib_submit_io(REQ_OP_WRITE, REQ_SYNC,
swsusp_resume_block, swsusp_header, NULL);
} else {
- printk(KERN_ERR "PM: Swap header not found!\n");
+ printk(KERN_ERR "PM: Swap header not found! Found %10s instead.\n",
+ swsusp_header->sig);
error = -ENODEV;
}
return error;