[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180612205619.28156-13-anchalag@amazon.com>
Date: Tue, 12 Jun 2018 20:56:19 +0000
From: Anchal Agarwal <anchalag@...zon.com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <hpa@...or.com>,
<x86@...nel.org>
CC: <boris.ostrovsky@...cle.com>, <konrad.wilk@...cle.com>,
<roger.pau@...rix.com>, <netdev@...r.kernel.org>,
<jgross@...e.com>, <xen-devel@...ts.xenproject.org>,
<linux-kernel@...r.kernel.org>, <kamatam@...zon.com>,
<anchalag@...zon.com>, <fllinden@...zon.com>, <vallish@...zon.com>,
<guruanb@...zon.com>, <eduval@...zon.com>, <rjw@...ysocki.net>,
<pavel@....cz>, <len.brown@...el.com>, <linux-pm@...r.kernel.org>,
<cyberax@...zon.com>
Subject: [RFC PATCH 12/12] PM / hibernate: update the resume offset on SNAPSHOT_SET_SWAP_AREA
From: Aleksei Besogonov <cyberax@...zon.com>
The SNAPSHOT_SET_SWAP_AREA is supposed to be used to set the hibernation
offset on a running kernel to enable hibernating to a swap file.
However, it doesn't actually update the swsusp_resume_block variable. As
a result, the hibernation fails at the last step (after all the data is
written out) in the validation of the swap signature in
mark_swapfiles().
Before this patch, the command line processing was the only place where
swsusp_resume_block was set.
Signed-off-by: Aleksei Besogonov <cyberax@...zon.com>
Signed-off-by: Munehisa Kamata <kamatam@...zon.com>
Signed-off-by: Anchal Agarwal <anchalag@...zon.com>
Reviewed-by: Munehisa Kamata <kamatam@...zon.com>
Reviewed-by: Eduardo Valentin <eduval@...zon.com>
---
kernel/power/user.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/power/user.c b/kernel/power/user.c
index abd2255..b522a42 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -379,8 +379,12 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
if (swdev) {
offset = swap_area.offset;
data->swap = swap_type_of(swdev, offset, NULL);
- if (data->swap < 0)
+ if (data->swap < 0) {
error = -ENODEV;
+ } else {
+ swsusp_resume_device = swdev;
+ swsusp_resume_block = offset;
+ }
} else {
data->swap = -1;
error = -EINVAL;
--
2.7.4
Powered by blists - more mailing lists