From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932299AbZBNBXh (ORCPT ); Fri, 13 Feb 2009 20:23:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762940AbZBNBIu (ORCPT ); Fri, 13 Feb 2009 20:08:50 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:40919 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762630AbZBNBIo (ORCPT ); Fri, 13 Feb 2009 20:08:44 -0500 From: "Rafael J. Wysocki" To: Len Brown Subject: [PATCH 7/9] PM: Fix pm_notifiers during user mode hibernation Date: Sat, 14 Feb 2009 02:05:14 +0100 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc5-tst; KDE/4.2.0; x86_64; ; ) Cc: Andrew Morton , Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= , Greg KH , Ingo Molnar , Johannes Weiner , KOSAKI Motohiro , LKML , Linus Torvalds , Pavel Machek , pm list , Arjan van de Ven , Alan Jenkins , Masami Hiramatsu , Andrey Borzenkov References: <200902140157.40869.rjw@sisk.pl> In-Reply-To: <200902140157.40869.rjw@sisk.pl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902140205.16278.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Borzenkov Snapshot device is opened with O_RDONLY during suspend and O_WRONLY durig resume. Make sure we also call notifiers with correct parameter telling them what we are really doing. Signed-off-by: Andrey Borzenkov Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek --- kernel/power/user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) Index: linux-2.6/kernel/power/user.c =================================================================== --- linux-2.6.orig/kernel/power/user.c +++ linux-2.6/kernel/power/user.c @@ -95,15 +95,15 @@ static int snapshot_open(struct inode *i data->swap = swsusp_resume_device ? swap_type_of(swsusp_resume_device, 0, NULL) : -1; data->mode = O_RDONLY; - error = pm_notifier_call_chain(PM_RESTORE_PREPARE); + error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); if (error) - pm_notifier_call_chain(PM_POST_RESTORE); + pm_notifier_call_chain(PM_POST_HIBERNATION); } else { data->swap = -1; data->mode = O_WRONLY; - error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); + error = pm_notifier_call_chain(PM_RESTORE_PREPARE); if (error) - pm_notifier_call_chain(PM_POST_HIBERNATION); + pm_notifier_call_chain(PM_POST_RESTORE); } if (error) atomic_inc(&snapshot_device_available);