From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261210AbVEaXuj (ORCPT ); Tue, 31 May 2005 19:50:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261211AbVEaXuj (ORCPT ); Tue, 31 May 2005 19:50:39 -0400 Received: from gate.crashing.org ([63.228.1.57]:48568 "EHLO gate.crashing.org") by vger.kernel.org with ESMTP id S261210AbVEaXuV (ORCPT ); Tue, 31 May 2005 19:50:21 -0400 Subject: Re: [PATCH] Don't explode on swsusp failure to find swap From: Benjamin Herrenschmidt To: Pavel Machek Cc: Linux-pm mailing list , Linux Kernel list In-Reply-To: <1117550706.5826.43.camel@gaston> References: <1117523585.5826.18.camel@gaston> <20050531103623.GB1848@elf.ucw.cz> <1117550706.5826.43.camel@gaston> Content-Type: text/plain Date: Wed, 01 Jun 2005 09:50:03 +1000 Message-Id: <1117583403.5826.72.camel@gaston> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2005-06-01 at 00:45 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2005-05-31 at 12:36 +0200, Pavel Machek wrote: > > Hi! > > > > > If we specify a swap device for swsusp using resume= kernel argument and > > > that device doesn't exist in the swap list, we end up calling > > > swsusp_free() before we have allocated pagedir_save. That causes us to > > > explode when trying to free it. > > > > > > Pavel, does that look right ? > > > > It looks like a workaround. We should not call swsusp_free in case > > device does not exists. Quick look did not reveal where the bug comes > > from, can you try to trace it? > > Pavel > > Well, the bug comes from arch code calling swsusp_save() which fails, > then we call swsusp_free() More specifically, arch suspend calls swsusp_save(). It fails and returns the error to the arch asm code, which itself returns it to it's caller swsusp_suspend(), which does that: if ((error = swsusp_arch_suspend())) swsusp_free(); Ben.