]> Git Repo - linux.git/commitdiff
[PATCH] swsusp: Fix swap_type_of
authorRafael J. Wysocki <[email protected]>
Sun, 27 Aug 2006 08:23:25 +0000 (01:23 -0700)
committerLinus Torvalds <[email protected]>
Sun, 27 Aug 2006 18:01:28 +0000 (11:01 -0700)
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]>
mm/swapfile.c

index e70d6c6d6fee6f626a0c247c53f213413454cd0e..f1f5ec783781cfebcbd4f3c5efe79336eaedcfa1 100644 (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);
This page took 0.050691 seconds and 4 git commands to generate.