Skip to content

Commit fe9161d

Browse files
Srivatsa S. Bhatrjwysocki
authored andcommitted
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
1 parent 62aa2b5 commit fe9161d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎kernel/power/user.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,15 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
249249
}
250250
pm_restore_gfp_mask();
251251
error = hibernation_snapshot(data->platform_support);
252-
if (!error) {
252+
if (error) {
253+
thaw_kernel_threads();
254+
} else {
253255
error = put_user(in_suspend, (int __user *)arg);
254256
if (!error && !freezer_test_done)
255257
data->ready = 1;
256258
if (freezer_test_done) {
257259
freezer_test_done = false;
258-
thaw_processes();
260+
thaw_kernel_threads();
259261
}
260262
}
261263
break;

0 commit comments

Comments
 (0)