public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH][Fix] swsusp: Fix swap_type_of
  2006-08-15 10:18 [PATCH][Fix] swsusp: Fix swap_type_of Rafael J. Wysocki
@ 2006-08-15 10:16 ` Pavel Machek
  2006-08-15 11:01   ` Rafael J. Wysocki
  2006-08-15 13:47   ` Antonino A. Daplas
  0 siblings, 2 replies; 4+ messages in thread
From: Pavel Machek @ 2006-08-15 10:16 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Andrew Morton, LKML

On Tue 2006-08-15 12:18:40, Rafael J. Wysocki wrote:
> 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.

ACK. (And I guess this is 2.6.18 material, right? Or is that fix not
needed in mainline?) 
								Pavel

> Index: linux-2.6.18-rc4-mm1/mm/swapfile.c
> ===================================================================
> --- linux-2.6.18-rc4-mm1.orig/mm/swapfile.c	2006-08-13 14:54:43.000000000 +0200
> +++ linux-2.6.18-rc4-mm1/mm/swapfile.c	2006-08-14 21:09:09.000000000 +0200
> @@ -442,11 +442,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);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH][Fix] swsusp: Fix swap_type_of
@ 2006-08-15 10:18 Rafael J. Wysocki
  2006-08-15 10:16 ` Pavel Machek
  0 siblings, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2006-08-15 10:18 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML, Pavel Machek

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 <rjw@sisk.pl>
---
 mm/swapfile.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6.18-rc4-mm1/mm/swapfile.c
===================================================================
--- linux-2.6.18-rc4-mm1.orig/mm/swapfile.c	2006-08-13 14:54:43.000000000 +0200
+++ linux-2.6.18-rc4-mm1/mm/swapfile.c	2006-08-14 21:09:09.000000000 +0200
@@ -442,11 +442,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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][Fix] swsusp: Fix swap_type_of
  2006-08-15 10:16 ` Pavel Machek
@ 2006-08-15 11:01   ` Rafael J. Wysocki
  2006-08-15 13:47   ` Antonino A. Daplas
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2006-08-15 11:01 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Andrew Morton, LKML

On Tuesday 15 August 2006 12:16, Pavel Machek wrote:
> On Tue 2006-08-15 12:18:40, Rafael J. Wysocki wrote:
> > 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.
> 
> ACK. (And I guess this is 2.6.18 material, right? Or is that fix not
> needed in mainline?) 

Oh, yes I think it is needed.  2.6.18 material, surely.

Rafael


-- 
You never change things by fighting the existing reality.
		R. Buckminster Fuller

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH][Fix] swsusp: Fix swap_type_of
  2006-08-15 10:16 ` Pavel Machek
  2006-08-15 11:01   ` Rafael J. Wysocki
@ 2006-08-15 13:47   ` Antonino A. Daplas
  1 sibling, 0 replies; 4+ messages in thread
From: Antonino A. Daplas @ 2006-08-15 13:47 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Rafael J. Wysocki, Andrew Morton, LKML

On Tue, 2006-08-15 at 12:16 +0200, Pavel Machek wrote:
> On Tue 2006-08-15 12:18:40, Rafael J. Wysocki wrote:
> > 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.
> 
> ACK. (And I guess this is 2.6.18 material, right? Or is that fix not
> needed in mainline?) 

This fixed an oops on suspend to disk.  Definitely 2.6.18 material.

Tony



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-08-15 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-15 10:18 [PATCH][Fix] swsusp: Fix swap_type_of Rafael J. Wysocki
2006-08-15 10:16 ` Pavel Machek
2006-08-15 11:01   ` Rafael J. Wysocki
2006-08-15 13:47   ` Antonino A. Daplas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox