patch-2.0.20 linux/mm/vmscan.c

Next file: linux/CREDITS
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.19/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -108,8 +108,13 @@
 		} else {
 			if (page_map->count != 1)
 				return 0;
-			if (!(entry = get_swap_page()))
-				return 0;	/* Aieee!!! Out of swap space! */
+			if (!(entry = get_swap_page())) {
+				/* Aieee!!! Out of swap space! */
+				int retval = -1;
+				if (nr_swapfiles == 0)
+					retval = 0;
+				return retval;
+			}
 			vma->vm_mm->rss--;
 			flush_cache_page(vma, address);
 			set_pte(page_table, __pte(entry));
@@ -312,6 +317,9 @@
 		if (!--p->swap_cnt)
 			swap_task++;
 		switch (swap_out_process(p, dma, wait)) {
+			/* out of swap space? */
+			case -1:
+				return 0;
 			case 0:
 				if (p->swap_cnt)
 					swap_task++;


FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov