]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
PM / Hibernate: Fix PM_POST_* notification with user-space suspend
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Dec 2010 23:16:39 +0000 (00:16 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Jan 2011 22:43:06 +0000 (14:43 -0800)
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>
kernel/power/user.c

index bf0014d6a5f0972a1b2352d35a09eb82296164d1..b1353560e5f24bcc47e4173be3cefda9ca378227 100644 (file)
@@ -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);