This could either be solved by making get_swaparea_info() check for
ptr->swap_map, or check for ((ptr->flags & SWP_WRITEOK) == SWP_WRITEOK).
The patch below (applicable to 2.4.5 - patch for 2.2 in following email)
checks for the former on the grounds that that is what's causing the
immediate problem, and some people might want to be able to use
/proc/swaps to track the progress of a swapoff().
Paul
diff -Naur linux/mm/swapfile.c linux.new/mm/swapfile.c
--- linux/mm/swapfile.c Wed Apr 11 21:59:56 2001
+++ linux.new/mm/swapfile.c Fri Jun 8 17:18:32 2001
@@ -503,7 +503,7 @@
len += sprintf(buf, "Filename\t\t\tType\t\tSize\tUsed\tPriority\n");
for (i = 0 ; i < nr_swapfiles ; i++, ptr++) {
- if (ptr->flags & SWP_USED) {
+ if ((ptr->flags & SWP_USED) && ptr->swap_map) {
char * path = d_path(ptr->swap_file, ptr->swap_vfsmnt,
page, PAGE_SIZE);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/