On Thu, Jul 14, 2016 at 12:00 AM, Rafael J. Wysocki <rafael@xxxxxxxxxx> wrote:OK, I've used this solution and sent a v3 out.
On Wed, Jul 13, 2016 at 11:45 PM, Pavel Machek <pavel@xxxxxx> wrote:Or rather call free_basic_memory_bitmaps() and
On Wed 2016-07-13 22:44:24, Rafael J. Wysocki wrote:OK, there is a bug.
On Wed, Jul 13, 2016 at 10:26 PM, Pavel Machek <pavel@xxxxxx> wrote:@@ -721,6 +724,9 @@ int hibernate(void)
On Wed 2016-07-13 22:04:27, Rafael J. Wysocki wrote:It shouldn't matter how they are mounted, because the contents of
On Wed, Jul 13, 2016 at 7:01 PM, Pavel Machek <pavel@xxxxxx> wrote:New version changes nothing, right? You still need to be sure
Hi!Please see the new version of this patch:
Actually... If you could addOK.and then swapon the swap device, and do a testing. This should be safer?Yeah, that's the way. Read-only root is other option.
Just add fat warning into the documentation.I guess updating documentation would be welcome from my side,OK, I'll update the documents.
otherwise it should be ok.
printk(KERN_ALERT "Hibernation image written. If you have any
filesystems mounted read-write and attempt to resume, you'll corrupt
your data. To prevent that, remove the hibernation image.\n")
...I guess that would save someone's filesystem. (Yes, very high
loglevel. If you attempt to do this from anything else then singleuser
or initrd, you are asking for problems, so... lets make sure user sees
it.)
https://patchwork.kernel.org/patch/9226837/
filesystems are not mounted r/w. So I would still like to see printk()
with warning.
persistent storage don't change.
atomic_inc(&snapshot_device_available);
Unlock:
unlock_system_sleep();
+ if (snapshot_test)
+ software_resume();
+
return error;
}
Aha, I see, immediate wakeup here. Makes sense. ... ...
No.
AFAICT, freezer is used in hibernation_snapshot, which means at
Unlock:, kernel threads are running; software_resume() freezes them
again, but they had chance to run and potentially corrupt the
persistent storage... right?
The thawing of user space is potentially dangerous, so in the
"snapshot" test mode hibernate() should just call
free_basic_memory_bitmaps() and from there invoke the code below the
Check_image label in software_resume(), roughly.
unlock_device_hotplug(), then do swsusp_check() and invoke the code
starting with the "PM: Loading hibernation image.\n" message in
software_resume().
Thanks,
Rafael