Module Name:    src
Committed By:   riastradh
Date:           Sun Mar 19 23:47:46 UTC 2017

Modified Files:
        src/sys/uvm: uvm_bio.c

Log Message:
#if DIAGNOSTIC panic ---> KASSERT


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/uvm/uvm_bio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_bio.c
diff -u src/sys/uvm/uvm_bio.c:1.83 src/sys/uvm/uvm_bio.c:1.84
--- src/sys/uvm/uvm_bio.c:1.83	Wed May 27 19:43:40 2015
+++ src/sys/uvm/uvm_bio.c	Sun Mar 19 23:47:46 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_bio.c,v 1.83 2015/05/27 19:43:40 rmind Exp $	*/
+/*	$NetBSD: uvm_bio.c,v 1.84 2017/03/19 23:47:46 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1998 Chuck Silvers.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.83 2015/05/27 19:43:40 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_bio.c,v 1.84 2017/03/19 23:47:46 riastradh Exp $");
 
 #include "opt_uvmhist.h"
 #include "opt_ubc.h"
@@ -346,14 +346,14 @@ ubc_fault(struct uvm_faultinfo *ufi, vad
 	UVMHIST_LOG(ubchist, "va 0x%lx ubc_offset 0x%lx access_type %d",
 	    va, ubc_offset, access_type, 0);
 
-#ifdef DIAGNOSTIC
 	if ((access_type & VM_PROT_WRITE) != 0) {
-		if (slot_offset < trunc_page(umap->writeoff) ||
-		    umap->writeoff + umap->writelen <= slot_offset) {
-			panic("ubc_fault: out of range write");
-		}
+		KASSERTMSG((trunc_page(umap->writeoff) <= slot_offset),
+		    "out of range write: slot=0x%lx off=0x%lx",
+		    slot_offset, umap->writeoff);
+		KASSERTMSG((slot_offset < umap->writeoff + umap->writelen),
+		    "out of range write: slot=0x%lx off=0x%lx len=0x%lx",
+		    slot_offset, umap->writeoff, umap->writelen);
 	}
-#endif
 
 	/* no umap locking needed since we have a ref on the umap */
 	uobj = umap->uobj;

Reply via email to