Module Name: src
Committed By: rmind
Date: Fri Jun 24 01:48:43 UTC 2011
Modified Files:
src/sys/uvm: uvm_amap.c
Log Message:
amap_copy: fix one more regression, thanks to enami@.
To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/uvm/uvm_amap.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_amap.c
diff -u src/sys/uvm/uvm_amap.c:1.98 src/sys/uvm/uvm_amap.c:1.99
--- src/sys/uvm/uvm_amap.c:1.98 Fri Jun 24 01:39:22 2011
+++ src/sys/uvm/uvm_amap.c Fri Jun 24 01:48:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_amap.c,v 1.98 2011/06/24 01:39:22 rmind Exp $ */
+/* $NetBSD: uvm_amap.c,v 1.99 2011/06/24 01:48:43 rmind Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.98 2011/06/24 01:39:22 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_amap.c,v 1.99 2011/06/24 01:48:43 rmind Exp $");
#include "opt_uvmhist.h"
@@ -818,7 +818,11 @@
UVMHIST_LOG(maphist, "<- done [creating new amap 0x%x->0x%x]",
entry->start, entry->end, 0, 0);
- /* Allocate an initialised amap and install it. */
+ /*
+ * Allocate an initialised amap and install it.
+ * Note: we must update the length after clipping.
+ */
+ len = entry->end - entry->start;
entry->aref.ar_pageoff = 0;
entry->aref.ar_amap = amap_alloc(len, 0, waitf);
if (entry->aref.ar_amap != NULL) {