[PATCH] swsusp: Fix swap_type_of

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 <[email protected]>
Cc: Hugh Dickins <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Rafael J. Wysocki 2006-08-27 01:23:25 -07:00 • committed by Linus Torvalds
commit b6b5bce357

View file

@ -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);