From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754301Ab2A3WrY (ORCPT ); Mon, 30 Jan 2012 17:47:24 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:57099 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751722Ab2A3WrW (ORCPT ); Mon, 30 Jan 2012 17:47:22 -0500 From: "Rafael J. Wysocki" To: "Srivatsa S. Bhat" Subject: Re: [PATCH] PM/Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl path Date: Mon, 30 Jan 2012 23:50:57 +0100 User-Agent: KMail/1.13.6 (Linux/3.3.0-rc1+; KDE/4.6.0; x86_64; ; ) Cc: "pavel@ucw.cz" , "len.brown@intel.com" , Tejun Heo , Linux PM mailing list , "linux-kernel" References: <4F271188.3060107@linux.vnet.ibm.com> In-Reply-To: <4F271188.3060107@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201302350.57661.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, January 30, 2012, Srivatsa S. Bhat wrote: > 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. > > Cc: stable@vger.kernel.org > Signed-off-by: Srivatsa S. Bhat Applied. Thanks, Rafael > --- > This applies on top of the patch posted at https://lkml.org/lkml/2012/1/27/501 > > 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 e5a21a8..3e10007 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, > } > 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; > > > >