| From 0d3b27d7ec5e0e8c4ec4f18e0543bd9a307519ee Mon Sep 17 00:00:00 2001 |
| From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> |
| Date: Wed, 1 Feb 2012 22:16:36 +0100 |
| Subject: PM / Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl |
| path |
| |
| In the SNAPSHOT_CREATE_IMAGE ioctl, if the call to hibernation_snapshot() |
| fails, the frozen tasks are not thawed. |
| |
| And in the case of success, if we happen to exit due to a successful freezer |
| test, all tasks (including those of userspace) are thawed, whereas actually |
| we should have thawed only the kernel threads at that point. Fix both these |
| issues. |
| |
| Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> |
| Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> |
| Cc: stable@vger.kernel.org |
| (cherry picked from commit fe9161db2e6053da21e4649d77bbefaf3030b11d) |
| |
| Signed-off-by: Simon Horman <horms@verge.net.au> |
| --- |
| kernel/power/user.c | 6 ++++-- |
| 1 file changed, 4 insertions(+), 2 deletions(-) |
| |
| diff --git a/kernel/power/user.c b/kernel/power/user.c |
| index e5a21a8..3e10007 100644 |
| --- a/kernel/power/user.c |
| +++ b/kernel/power/user.c |
| @@ -249,13 +249,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, |
| } |
| pm_restore_gfp_mask(); |
| error = hibernation_snapshot(data->platform_support); |
| - if (!error) { |
| + if (error) { |
| + thaw_kernel_threads(); |
| + } else { |
| error = put_user(in_suspend, (int __user *)arg); |
| if (!error && !freezer_test_done) |
| data->ready = 1; |
| if (freezer_test_done) { |
| freezer_test_done = false; |
| - thaw_processes(); |
| + thaw_kernel_threads(); |
| } |
| } |
| break; |
| -- |
| 1.7.10.1.362.g242cab3 |
| |