mm/swapfile.c problem

Pete Zaitcev (zaitcev@metabyte.com)
Mon, 13 Sep 1999 23:09:00 -0700 (PDT)


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/