diff options
| author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2012-02-01 16:16:36 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-02-01 16:16:36 -0500 |
| commit | fe9161db2e6053da21e4649d77bbefaf3030b11d (patch) | |
| tree | 3f875f40201455571280eef7a0c9fdc3c98e346e /kernel | |
| parent | 62aa2b537c6f5957afd98e29f96897419ed5ebab (diff) | |
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
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/power/user.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index e5a21a857302..3e100075b13c 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, | |||
| 249 | } | 249 | } |
| 250 | pm_restore_gfp_mask(); | 250 | pm_restore_gfp_mask(); |
| 251 | error = hibernation_snapshot(data->platform_support); | 251 | error = hibernation_snapshot(data->platform_support); |
| 252 | if (!error) { | 252 | if (error) { |
| 253 | thaw_kernel_threads(); | ||
| 254 | } else { | ||
| 253 | error = put_user(in_suspend, (int __user *)arg); | 255 | error = put_user(in_suspend, (int __user *)arg); |
| 254 | if (!error && !freezer_test_done) | 256 | if (!error && !freezer_test_done) |
| 255 | data->ready = 1; | 257 | data->ready = 1; |
| 256 | if (freezer_test_done) { | 258 | if (freezer_test_done) { |
| 257 | freezer_test_done = false; | 259 | freezer_test_done = false; |
| 258 | thaw_processes(); | 260 | thaw_kernel_threads(); |
| 259 | } | 261 | } |
| 260 | } | 262 | } |
| 261 | break; | 263 | break; |
