aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2010-12-10 00:16:39 +0100
committerAK <andi@firstfloor.org>2011-02-06 11:03:30 -0800
commitc85b1ca3a94d0a1de278faf545daa765f671b59b (patch)
treed830c8017e6a299a80ea3d66a4eb253caa47c520 /kernel
parent83ec6d3cccb0cd67613880b32c85fec88233d681 (diff)
PM / Hibernate: Fix PM_POST_* notification with user-space suspend
commit 1497dd1d29c6a53fcd3c80f7ac8d0e0239e7389e upstream. The user-space hibernation sends a wrong notification after the image restoration because of thinko for the file flag check. RDONLY corresponds to hibernation and WRONLY to restoration, confusingly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/power/user.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 1b2ea31e6bd..c36c3b9e8a8 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -137,7 +137,7 @@ static int snapshot_release(struct inode *inode, struct file *filp)
free_all_swap_pages(data->swap);
if (data->frozen)
thaw_processes();
- pm_notifier_call_chain(data->mode == O_WRONLY ?
+ pm_notifier_call_chain(data->mode == O_RDONLY ?
PM_POST_HIBERNATION : PM_POST_RESTORE);
atomic_inc(&snapshot_device_available);