diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-08-15 17:19:24 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-23 14:13:32 -0700 |
commit | 49071b9f45d2483dbde395fd6aa11f53974e7665 (patch) | |
tree | 05e6998b0bf4e455897b2818561607dd7e8517d8 /mm | |
parent | f5ce8b3e07e46f4ca1408d5e42f561028cd69719 (diff) |
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 <rjw@sisk.pl>
Cc: Hugh Dickins <hugh@veritas.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/swapfile.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index e5fd5385f0c..5a7760f176b 100644 --- a/mm/swapfile.c +++ b/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); |