Re: [PATCH][Fix] swsusp: Fix swap_type_of

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux