Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750792AbWHUSuj (ORCPT ); Mon, 21 Aug 2006 14:50:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750778AbWHUSuO (ORCPT ); Mon, 21 Aug 2006 14:50:14 -0400 Received: from ns2.suse.de ([195.135.220.15]:26045 "EHLO mx2.suse.de") by vger.kernel.org with ESMTP id S1750792AbWHUStz (ORCPT ); Mon, 21 Aug 2006 14:49:55 -0400 Date: Mon, 21 Aug 2006 11:48:14 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org, mm-commits@vger.kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk, rjw@sisk.pl, hugh@veritas.com, pavel@suse.cz, Greg Kroah-Hartman Subject: [patch 18/20] swsusp: Fix swap_type_of Message-ID: <20060821184814.GT21938@kroah.com> References: <20060821183818.155091391@quad.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="swsusp-fix-swap_type_of.patch" In-Reply-To: <20060821184527.GA21938@kroah.com> User-Agent: Mutt/1.5.12-2006-07-14 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1305 Lines: 41 -stable review patch. If anyone has any objections, please let us know. ------------------ From: "Rafael J. Wysocki" There is a bug in mm/swapfile.c#swap_type_of() that makes swsusp only be able to use the first active swap partition as the resume device. Fix it. Signed-off-by: Rafael J. Wysocki Cc: Hugh Dickins Acked-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- mm/swapfile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-2.6.17.9.orig/mm/swapfile.c +++ linux-2.6.17.9/mm/swapfile.c @@ -440,11 +440,12 @@ int swap_type_of(dev_t device) if (!(swap_info[i].flags & SWP_WRITEOK)) continue; + if (!device) { spin_unlock(&swap_lock); return i; } - inode = swap_info->swap_file->f_dentry->d_inode; + inode = swap_info[i].swap_file->f_dentry->d_inode; if (S_ISBLK(inode->i_mode) && device == MKDEV(imajor(inode), iminor(inode))) { spin_unlock(&swap_lock); -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/