All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] HAX: kernel/swsusp: Show invalid swap signature
@ 2017-10-17 23:23 Chris Wilson
  2017-10-17 23:45 ` ✓ Fi.CI.BAT: success for HAX: kernel/swsusp: Show invalid swap signature (rev2) Patchwork
  2017-10-18 10:20 ` ✓ Fi.CI.IGT: " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2017-10-17 23:23 UTC (permalink / raw)
  To: intel-gfx

---
 kernel/power/swap.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index d7cdc426ee38..1eed3fa04e21 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -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;
-- 
2.15.0.rc1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-10-18 10:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17 23:23 [PATCH] HAX: kernel/swsusp: Show invalid swap signature Chris Wilson
2017-10-17 23:45 ` ✓ Fi.CI.BAT: success for HAX: kernel/swsusp: Show invalid swap signature (rev2) Patchwork
2017-10-18 10:20 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.