PM: Fix warning in pm_restrict_gfp_mask() during SNAPSHOT_S2RAM ioctl
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 10 May 2011 19:09:53 +0000 (21:09 +0200)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:23 +0000 (14:23 -0500)
commit54cebcf8be8a43743c5a0504a31bdebd811d134d
treefe60183be426569758110f0cff654042d3d71c25
parent0dbf13bf86ccae441d1423bc671ccec0349710a9
PM: Fix warning in pm_restrict_gfp_mask() during SNAPSHOT_S2RAM ioctl

BugLink: http://bugs.launchpad.net/bugs/788691

commit 87186475a402391a1ca7d42a675c9b35a18dc348 upstream.

A warning is printed by pm_restrict_gfp_mask() while the
SNAPSHOT_S2RAM ioctl is being executed after creating a hibernation
image, because pm_restrict_gfp_mask() has been called once already
before the image creation and suspend_devices_and_enter() calls it
once again.  This happens after commit 452aa6999e6703ffbddd7f6ea124d3
(mm/pm: force GFP_NOIO during suspend/hibernation and resume).

To avoid this issue, move pm_restrict_gfp_mask() and
pm_restore_gfp_mask() from suspend_devices_and_enter() to its caller
in kernel/power/suspend.c.

Reported-by: Alexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
kernel/power/suspend.c