summaryrefslogtreecommitdiffstats
path: root/kernel/power/user.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-11-21 12:32:24 -0800
committerTejun Heo <tj@kernel.org>2011-11-21 12:32:24 -0800
commit03afed8bc296fa70186ba832c1126228bb992465 (patch)
tree96d0a6a9bffdcfc678d31f21caa88e43693bde94 /kernel/power/user.c
parent376fede80e74d98b49d1ba9ac18f23c9fd026ddd (diff)
downloadop-kernel-dev-03afed8bc296fa70186ba832c1126228bb992465.zip
op-kernel-dev-03afed8bc296fa70186ba832c1126228bb992465.tar.gz
freezer: clean up freeze_processes() failure path
freeze_processes() failure path is rather messy. Freezing is canceled for workqueues and tasks which aren't frozen yet but frozen tasks are left alone and should be thawed by the caller and of course some callers (xen and kexec) didn't do it. This patch updates __thaw_task() to handle cancelation correctly and makes freeze_processes() and freeze_kernel_threads() call thaw_processes() on failure instead so that the system is fully thawed on failure. Unnecessary [suspend_]thaw_processes() calls are removed from kernel/power/hibernate.c, suspend.c and user.c. While at it, restructure error checking if clause in suspend_prepare() to be less weird. -v2: Srivatsa spotted missing removal of suspend_thaw_processes() in suspend_prepare() and error in commit message. Updated. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r--kernel/power/user.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 6d8f535..7cc3f5b 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -257,10 +257,8 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
break;
error = freeze_processes();
- if (error) {
- thaw_processes();
+ if (error)
usermodehelper_enable();
- }
if (!error)
data->frozen = 1;
break;
OpenPOWER on IntegriCloud