[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200107234457.GA18829@dev-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com>
Date: Tue, 7 Jan 2020 23:44:57 +0000
From: Anchal Agarwal <anchalag@...zon.com>
To: <tglx@...utronix.de>, <mingo@...hat.com>, <bp@...en8.de>,
<hpa@...or.com>, <x86@...nel.org>, <boris.ostrovsky@...cle.com>,
<jgross@...e.com>, <linux-pm@...r.kernel.org>,
<linux-mm@...ck.org>, <kamatam@...zon.com>,
<sstabellini@...nel.org>, <konrad.wilk@...cle.co>,
<roger.pau@...rix.com>, <axboe@...nel.dk>, <davem@...emloft.net>,
<rjw@...ysocki.net>, <len.brown@...el.com>, <pavel@....cz>,
<peterz@...radead.org>, <eduval@...zon.com>, <sblbir@...zon.com>,
<anchalag@...zon.com>, <xen-devel@...ts.xenproject.org>,
<vkuznets@...hat.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<Woodhouse@...-dsk-anchalag-2a-9c2d1d96.us-west-2.amazon.com>,
<dwmw@...zon.co.uk>, <fllinden@...ozn.com>
CC: <anchalag@...zon.com>
Subject: [RFC PATCH V2 10/11] 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>
---
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 77438954cc2b..d396e313cb7b 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -374,8 +374,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.15.3.AMZN
Powered by blists - more mailing lists