[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <61d94dd74e238edeb264d8e3aa43847b93f986b6.1598042152.git.anchalag@amazon.com>
Date: Fri, 21 Aug 2020 22:31:14 +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.com>,
<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>, <dwmw@...zon.co.uk>,
<benh@...nel.crashing.org>
Subject: [PATCH v3 11/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.
[Anchal Agarwal: Changelog: Resolved patch conflict as code fragmented to
snapshot_set_swap_area]
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 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/power/user.c b/kernel/power/user.c
index d5eedc2baa2a..704a7173e99c 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -242,9 +242,12 @@ static int snapshot_set_swap_area(struct snapshot_data *data,
return -EINVAL;
}
data->swap = swap_type_of(swdev, offset, &bdev);
- if (data->swap < 0)
+ if (data->swap < 0) {
return -ENODEV;
-
+ } else {
+ swsusp_resume_device = swdev;
+ swsusp_resume_block = offset;
+ }
data->bd_inode = bdev->bd_inode;
bdput(bdev);
return 0;
--
2.16.6
Powered by blists - more mailing lists