lkml.org 
[lkml]   [1999]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectmm/swapfile.c problem
Hi, I have a small problem with 2.3.18.

If a swap device does not come online on reboot, sys_swapon() does
lock_page(), then rw_swap_page_nolock (unsuccessful) and goes to
bad_swap, where it calls free_page(swap_header). This causes the
following diagnostic: "kernel BUG in page_alloc.c:161", and a NULL
pointer dereference somewhere down the line. I would like to see
something along these lines:

--- mm/swapfile.c 1999/08/31 06:50:36 1.59
+++ mm/swapfile.c 1999/09/14 05:48:49
@@ -771,8 +771,11 @@
if (!(swap_flags & SWAP_FLAG_PREFER))
++least_priority;
out:
- if (swap_header)
+ if (swap_header) {
+ mem_map_t *page = mem_map + MAP_NR(swap_header);
+ UnlockPage(page);
free_page((long) swap_header);
+ }
unlock_kernel();
return error;
}
Thanks,
--Pete

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.032 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site