[PATCH] fix suspend to disk swap_type_of() function

From: Andreas Steinmetz
Date: Tue Sep 12 2006 - 13:49:26 EST


The attached patch fixes swap_type_of() for the case the suspend device
is not the first swap device. This looks like a cut'n'paste fix. Patch
is against 2.6.17.8.
--
Andreas Steinmetz SPAMmers use robotrap@xxxxxxxx
--- linux.orig/mm/swapfile.c 2006-09-12 19:33:51.000000000 +0200
+++ linux/mm/swapfile.c 2006-09-12 19:34:58.000000000 +0200
@@ -444,7 +444,7 @@ int swap_type_of(dev_t 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);