]> git.karo-electronics.de Git - karo-tx-linux.git/commit
freezer: clean up freeze_processes() failure path
authorTejun Heo <tj@kernel.org>
Thu, 3 Nov 2011 22:19:27 +0000 (15:19 -0700)
committerTejun Heo <tj@kernel.org>
Thu, 3 Nov 2011 22:19:27 +0000 (15:19 -0700)
commit2981f8990826d8ab411c7d7bba59bfb7540a015c
tree222c7ed980bdc0665ef08cccd7931acddcc6d363
parent144abdba9ba76a98719ee033a36406e17a954418
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>
include/linux/freezer.h
kernel/freezer.c
kernel/power/hibernate.c
kernel/power/process.c
kernel/power/suspend.c
kernel/power/user.c