Module Name:    src
Committed By:   martin
Date:           Fri Jun  1 14:52:49 UTC 2012

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

Log Message:
Only use generic readahead on VREG vnodes, the space used to store the
context is not valid on other types.
Prevents the crash reported in PR kern/38889, but does not fix the
mmap of block devices, more work is needed (no size on VBLK vnodes).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/uvm/uvm_vnode.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_vnode.c
diff -u src/sys/uvm/uvm_vnode.c:1.97 src/sys/uvm/uvm_vnode.c:1.98
--- src/sys/uvm/uvm_vnode.c:1.97	Tue Sep  6 16:41:55 2011
+++ src/sys/uvm/uvm_vnode.c	Fri Jun  1 14:52:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_vnode.c,v 1.97 2011/09/06 16:41:55 matt Exp $	*/
+/*	$NetBSD: uvm_vnode.c,v 1.98 2012/06/01 14:52:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.97 2011/09/06 16:41:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.98 2012/06/01 14:52:48 martin Exp $");
 
 #include "opt_uvmhist.h"
 
@@ -170,7 +170,8 @@ uvn_get(struct uvm_object *uobj, voff_t 
 
 	UVMHIST_LOG(ubchist, "vp %p off 0x%x", vp, (int)offset, 0,0);
 
-	if ((access_type & VM_PROT_WRITE) == 0 && (flags & PGO_LOCKED) == 0) {
+	if (vp->v_type == VREG && (access_type & VM_PROT_WRITE) == 0
+	    && (flags & PGO_LOCKED) == 0) {
 		vn_ra_allocctx(vp);
 		uvm_ra_request(vp->v_ractx, advice, uobj, offset,
 		    *npagesp << PAGE_SHIFT);

Reply via email to