Commit 9744997a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / Hibernate: Make snapshot_release() restore GFP mask

If the process using the hibernate user space interface closes
/dev/snapshot after creating a hibernation image without thawing
tasks, snapshot_release() should call pm_restore_gfp_mask() to
restore the GFP mask used before the creation of the image.  Make
that happen.
Tested-by: default avatarAlexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
parent 87186475
...@@ -135,8 +135,10 @@ static int snapshot_release(struct inode *inode, struct file *filp) ...@@ -135,8 +135,10 @@ static int snapshot_release(struct inode *inode, struct file *filp)
free_basic_memory_bitmaps(); free_basic_memory_bitmaps();
data = filp->private_data; data = filp->private_data;
free_all_swap_pages(data->swap); free_all_swap_pages(data->swap);
if (data->frozen) if (data->frozen) {
pm_restore_gfp_mask();
thaw_processes(); thaw_processes();
}
pm_notifier_call_chain(data->mode == O_RDONLY ? pm_notifier_call_chain(data->mode == O_RDONLY ?
PM_POST_HIBERNATION : PM_POST_RESTORE); PM_POST_HIBERNATION : PM_POST_RESTORE);
atomic_inc(&snapshot_device_available); atomic_inc(&snapshot_device_available);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment