Skip to content

Commit

Permalink
[PATCH] swsusp: Fix swap_type_of
Browse files Browse the repository at this point in the history
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>
Cc: Hugh Dickins <hugh@veritas.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Aug 27, 2006
1 parent c06aad8 commit b6b5bce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b6b5bce

Please sign in to comment.