From: Hugh Dickins <hugh@veritas.com> Aha, swsusp dips into swap_info[], better update it to swap_lock. It's bitflipping flags with 0xFF, so get_swap_page will allocate from only the one chosen device: let's change that to flip SWP_WRITEOK. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> --- kernel/power/swsusp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff -puN kernel/power/swsusp.c~swap-update-swsusp-use-of-swap_info kernel/power/swsusp.c --- devel/kernel/power/swsusp.c~swap-update-swsusp-use-of-swap_info 2005-07-12 14:21:39.000000000 -0700 +++ devel-akpm/kernel/power/swsusp.c 2005-07-12 14:21:39.000000000 -0700 @@ -179,9 +179,9 @@ static int swsusp_swap_check(void) /* Th len=strlen(resume_file); root_swap = 0xFFFF; - swap_list_lock(); + spin_lock(&swap_lock); for (i=0; i<MAX_SWAPFILES; i++) { - if (swap_info[i].flags == 0) { + if (!swap_info[i].flags & SWP_WRITEOK) { swapfile_used[i]=SWAPFILE_UNUSED; } else { if (!len) { @@ -202,7 +202,7 @@ static int swsusp_swap_check(void) /* Th } } } - swap_list_unlock(); + spin_unlock(&swap_lock); return (root_swap != 0xffff) ? 0 : -ENODEV; } @@ -216,12 +216,12 @@ static void lock_swapdevices(void) { int i; - swap_list_lock(); + spin_lock(&swap_lock); for (i = 0; i< MAX_SWAPFILES; i++) if (swapfile_used[i] == SWAPFILE_IGNORED) { - swap_info[i].flags ^= 0xFF; + swap_info[i].flags ^= SWP_WRITEOK; } - swap_list_unlock(); + spin_unlock(&swap_lock); } /** _