All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Chen Yu <yu.c.chen@intel.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PM / hibernate: Introduce snapshot test mode for hibernation
Date: Wed, 13 Jul 2016 23:45:46 +0200	[thread overview]
Message-ID: <20160713214546.GA26692@amd> (raw)
In-Reply-To: <CAJZ5v0hsero4EhCwjo2mz4tN4aHj=bhsgcVJUYjHF9Kem=6M6g@mail.gmail.com>

On Wed 2016-07-13 22:44:24, Rafael J. Wysocki wrote:
> On Wed, Jul 13, 2016 at 10:26 PM, Pavel Machek <pavel@ucw.cz> wrote:
> > On Wed 2016-07-13 22:04:27, Rafael J. Wysocki wrote:
> >> On Wed, Jul 13, 2016 at 7:01 PM, Pavel Machek <pavel@ucw.cz> wrote:
> >> > Hi!
> >> >
> >> >> >>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.
> >> >> >
> >> >> >>>I guess updating documentation would be welcome from my side,
> >> >> >>>otherwise it should be ok.
> >> >> >>OK, I'll  update the documents.
> >> >> >Just add fat warning into the documentation.
> >> >> OK.
> >> >
> >> > Actually... If you could add
> >> >
> >> > 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.)
> >>
> >> Please see the new version of this patch:
> >> https://patchwork.kernel.org/patch/9226837/
> >
> > New version changes nothing, right? You still need to be sure
> > filesystems are not mounted r/w. So I would still like to see printk()
> > with warning.
> 
> It shouldn't matter how they are mounted, because the contents of
> persistent storage don't change.

@@ -721,6 +724,9 @@  int hibernate(void)
   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?

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2016-07-13 21:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-07  6:40 [PATCH] PM / hibernate: Introduce snapshot test mode for hibernation Chen Yu
2016-07-13  9:50 ` Pavel Machek
2016-07-13 10:20   ` Chen Yu
2016-07-13 10:21     ` Pavel Machek
2016-07-13 10:39       ` Chen Yu
2016-07-13 17:01         ` Pavel Machek
2016-07-13 20:04           ` Rafael J. Wysocki
2016-07-13 20:26             ` Pavel Machek
2016-07-13 20:44               ` Rafael J. Wysocki
2016-07-13 21:45                 ` Pavel Machek [this message]
2016-07-13 22:00                   ` Rafael J. Wysocki
2016-07-13 22:18                     ` Rafael J. Wysocki
2016-07-14 10:44                       ` Chen Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160713214546.GA26692@amd \
    --to=pavel@ucw.cz \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=yu.c.chen@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.