提交 b6b5bce3 编写于 作者: R Rafael J. Wysocki 提交者: Linus Torvalds

[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: NRafael J. Wysocki <rjw@sisk.pl>
Cc: Hugh Dickins <hugh@veritas.com>
Acked-by: NPavel Machek <pavel@suse.cz>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c06aad85
...@@ -442,11 +442,12 @@ int swap_type_of(dev_t device) ...@@ -442,11 +442,12 @@ int swap_type_of(dev_t device)
if (!(swap_info[i].flags & SWP_WRITEOK)) if (!(swap_info[i].flags & SWP_WRITEOK))
continue; continue;
if (!device) { if (!device) {
spin_unlock(&swap_lock); spin_unlock(&swap_lock);
return i; 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) && if (S_ISBLK(inode->i_mode) &&
device == MKDEV(imajor(inode), iminor(inode))) { device == MKDEV(imajor(inode), iminor(inode))) {
spin_unlock(&swap_lock); spin_unlock(&swap_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册