From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: nigel@nigel.suspend2.net
Cc: "Erik Andrén" <erik.andren@gmail.com>,
"pm list" <linux-pm@lists.linux-foundation.org>,
"linux acpi" <linux-acpi@vger.kernel.org>
Subject: Re: [linux-pm] Re: [patch] hibernation: utilize ACPI hardware signature
Date: Wed, 2 Jan 2008 23:18:58 +0100 [thread overview]
Message-ID: <200801022318.59392.rjw@sisk.pl> (raw)
In-Reply-To: <477C0155.70902@nigel.suspend2.net>
On Wednesday, 2 of January 2008, Nigel Cunningham wrote:
> Hi.
>
> Rafael J. Wysocki wrote:
> > On Wednesday, 2 of January 2008, Erik Andrén wrote:
> >> Hi,
> >>
> >> 2008/1/2, Shaohua Li <shaohua.li@intel.com>:
> >>> ACPI defines a hardware signature. BIOS calculates the signature
> >>> according to hardware configure, if hardware changes, the signature will
> >>> change, in this case, S4 resume should fail.
> >>>
> >>> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> >>> ---
> >>
> >> Would it be possible to extend this mechanism to prevent the following
> >> scenario:
> >>
> >> 1. Linux image A is suspended to disk
> >> 2. Linux image B is booted and various changes to the system are done.
> >> 3. Linux image B is shut down
> >> 4. Linux image A is booted, restoring the suspend to disk image.
> >> 5. Chaos is ensured as the file system state is changed in regard to how
> >> linux image A expects it.
> >>
> >> Correct behaviour would naturally be that image A detects that changes have
> >> been made under its feet and proceed to perform a normal boot instead of
> >> resuming the stored suspend-to-disk image.
> >
> > It should be possible in theory.
> >
> >> Is there another mechanism preventing this?
> >
> > Not at the kernel level, but you can prevent this from happening by running
> > mkswap on all swap spaces that refuse to come up after a fresh boot.
>
> We really should do something about this. It should be possible to
> handle this properly if something along the following lines was implemented:
>
> 1) Each filesystem implements a function taking a pointer to a struct
> block_device and returns a mount count for that filesystem without
> making any modifications to the filesystem.
> 2) Hibernation implementations store the major & minor numbers and mount
> counts for each mounted filesystem in the image header when hibernating,
> and recheck those values at resume time. If the mount count on any
> filesystem has changes, we warn the user, invalidate the image and boot
> normally.
That may quickly become complicated.
For example, boot kernel need not contain all drivers used by the hibernated
ones, so some filesystems may be physically inaccessible to them.
Greetings,
Rafael
-
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-01-02 22:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-02 6:59 [patch] hibernation: utilize ACPI hardware signature Shaohua Li
2008-01-02 7:37 ` [linux-pm] " Maxim Levitsky
2008-01-02 9:29 ` Johannes Berg
2008-01-03 1:52 ` Shaohua Li
2008-01-02 10:08 ` Erik Andrén
2008-01-02 14:12 ` Rafael J. Wysocki
2008-01-02 21:25 ` [linux-pm] " Nigel Cunningham
2008-01-02 22:18 ` Rafael J. Wysocki [this message]
2008-01-03 8:26 ` Nigel Cunningham
2008-01-02 14:05 ` Rafael J. Wysocki
2008-01-02 21:26 ` [linux-pm] " Nigel Cunningham
2008-01-02 22:01 ` Rafael J. Wysocki
2008-01-03 8:31 ` Nigel Cunningham
2008-01-03 16:58 ` Rafael J. Wysocki
2008-01-03 22:10 ` Nigel Cunningham
2008-01-03 5:36 ` Shaohua Li
2008-01-03 17:04 ` Rafael J. Wysocki
2008-01-04 5:41 ` Shaohua Li
2008-01-04 20:44 ` Rafael J. Wysocki
2008-01-07 1:46 ` Shaohua Li
2008-01-10 23:39 ` Rafael J. Wysocki
2008-01-11 1:07 ` Shaohua Li
2008-01-11 17:20 ` Rafael J. Wysocki
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=200801022318.59392.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=erik.andren@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=nigel@nigel.suspend2.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox