mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: linux-pm@lists.linux-foundation.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [linux-pm] [PATCH 3.0-rc3] PM: free memory bitmaps if opening /dev/snapshot fails
Date: Sat, 18 Jun 2011 22:44:36 +0200	[thread overview]
Message-ID: <201106182244.36876.rjw@sisk.pl> (raw)
In-Reply-To: <20110617175231.A80284030A@alaris.suse.cz>

On Friday, June 17, 2011, Michal Kubecek wrote:
> From: Michal Kubecek <mkubecek@suse.cz>
> 
> When opening /dev/snapshot device, snapshot_open() creates memory
> bitmaps which are freed in snapshot_release(). But if any of the
> callbacks called by pm_notifier_call_chain() returns NOTIFY_BAD, open()
> fails, snapshot_release() is never called and bitmaps are not freed.
> Next attempt to open /dev/snapshot then triggers BUG_ON() check in
> create_basic_memory_bitmaps(). This happens e.g. when vmwatchdog module
> is active on s390x.
> 
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>

Thanks, I'm going to push your patch for 3.0 + stable.

Rafael


> --- 
> 
> diff --git a/kernel/power/user.c b/kernel/power/user.c
> index 7d02d33..42ddbc6 100644
> --- a/kernel/power/user.c
> +++ b/kernel/power/user.c
> @@ -113,8 +113,10 @@ static int snapshot_open(struct inode *inode, struct file *filp)
>  		if (error)
>  			pm_notifier_call_chain(PM_POST_RESTORE);
>  	}
> -	if (error)
> +	if (error) {
> +		free_basic_memory_bitmaps();
>  		atomic_inc(&snapshot_device_available);
> +	}
>  	data->frozen = 0;
>  	data->ready = 0;
>  	data->platform_support = 0;
> _______________________________________________
> linux-pm mailing list
> linux-pm@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/linux-pm
> 
> 


           reply	other threads:[~2011-06-18 20:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20110617175231.A80284030A@alaris.suse.cz>]

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=201106182244.36876.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mkubecek@suse.cz \
    /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

all inboxes | Powered by JetHome®