linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: "pavel@ucw.cz" <pavel@ucw.cz>,
	"len.brown@intel.com" <len.brown@intel.com>,
	Tejun Heo <tj@kernel.org>,
	Linux PM mailing list <linux-pm@vger.kernel.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] PM/Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl path
Date: Mon, 30 Jan 2012 23:50:57 +0100	[thread overview]
Message-ID: <201201302350.57661.rjw@sisk.pl> (raw)
In-Reply-To: <4F271188.3060107@linux.vnet.ibm.com>

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 <srivatsa.bhat@linux.vnet.ibm.com>

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;
> 
> 
> 
> 


      reply	other threads:[~2012-01-30 22:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 21:54 [PATCH] PM/Hibernate: Thaw kernel threads in SNAPSHOT_CREATE_IMAGE ioctl path Srivatsa S. Bhat
2012-01-30 22:50 ` Rafael J. Wysocki [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201201302350.57661.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).