patch-2.2.0-pre2 linux/ipc/shm.c

Next file: linux/kernel/acct.c
Previous file: linux/include/linux/sysv_fs.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre1/linux/ipc/shm.c linux/ipc/shm.c
@@ -624,6 +624,7 @@
 	unsigned int id, idx;
 
 	id = SWP_OFFSET(code) & SHM_ID_MASK;
+#ifdef DEBUG_SHM
 	if (id != (SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK)) {
 		printk ("shm_swap_in: code id = %d and shmd id = %ld differ\n",
 			id, SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK);
@@ -633,12 +634,17 @@
 		printk ("shm_swap_in: id=%d too big. proc mem corrupted\n", id);
 		return BAD_PAGE;
 	}
+#endif
 	shp = shm_segs[id];
+
+#ifdef DEBUG_SHM
 	if (shp == IPC_UNUSED || shp == IPC_NOID) {
 		printk ("shm_swap_in: id=%d invalid. Race.\n", id);
 		return BAD_PAGE;
 	}
+#endif
 	idx = (SWP_OFFSET(code) >> SHM_IDX_SHIFT) & SHM_IDX_MASK;
+#ifdef DEBUG_SHM
 	if (idx != (offset >> PAGE_SHIFT)) {
 		printk ("shm_swap_in: code idx = %u and shmd idx = %lu differ\n",
 			idx, offset >> PAGE_SHIFT);
@@ -648,6 +654,7 @@
 		printk ("shm_swap_in : too large page index. id=%d\n", id);
 		return BAD_PAGE;
 	}
+#endif
 
 	pte = __pte(shp->shm_pages[idx]);
 	if (!pte_present(pte)) {

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