Skip to content

Commit

Permalink
PM / Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl path
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Srivatsa S. Bhat authored and Rafael J. Wysocki committed Feb 1, 2012
1 parent 62aa2b5 commit fe9161d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fe9161d

Please sign in to comment.