patch-2.0.36 linux/fs/proc/mem.c

Next file: linux/fs/read_write.c
Previous file: linux/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.35/linux/fs/proc/mem.c linux/fs/proc/mem.c
@@ -219,7 +219,7 @@
 	pgd_t *src_dir, *dest_dir;
 	pmd_t *src_middle, *dest_middle;
 	pte_t *src_table, *dest_table;
-	unsigned long stmp, dtmp;
+	unsigned long stmp, dtmp, mapnr;
 	struct vm_area_struct *src_vma = NULL;
 
 	/* Get the source's task information */
@@ -299,7 +299,9 @@
 
 		set_pte(src_table, pte_mkdirty(*src_table));
 		set_pte(dest_table, *src_table);
-		mem_map[MAP_NR(pte_page(*src_table))].count++;
+                mapnr = MAP_NR(pte_page(*src_table));
+		if (mapnr < MAP_NR(high_memory))
+                        mem_map[mapnr].count++;
 
 		stmp += PAGE_SIZE;
 		dtmp += PAGE_SIZE;

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