Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/uvm in uvm_findpage(), when uvm_page_array_fill_and_peek...



details:   https://anonhg.NetBSD.org/src/rev/7fe67b1255c1
branches:  trunk
changeset: 974888:7fe67b1255c1
user:      chs <chs%NetBSD.org@localhost>
date:      Sun Aug 16 00:24:41 2020 +0000

description:
in uvm_findpage(), when uvm_page_array_fill_and_peek() returns a page
that is not the one we want and we make an assertion about dirtiness,
check the dirty status of the page we wanted rather than the page we got.

diffstat:

 sys/uvm/uvm_vnode.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (34 lines):

diff -r de62973f9a68 -r 7fe67b1255c1 sys/uvm/uvm_vnode.c
--- a/sys/uvm/uvm_vnode.c       Sat Aug 15 16:09:07 2020 +0000
+++ b/sys/uvm/uvm_vnode.c       Sun Aug 16 00:24:41 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_vnode.c,v 1.116 2020/08/14 09:06:15 chs Exp $      */
+/*     $NetBSD: uvm_vnode.c,v 1.117 2020/08/16 00:24:41 chs 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.116 2020/08/14 09:06:15 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.117 2020/08/16 00:24:41 chs Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_uvmhist.h"
@@ -313,12 +313,13 @@
                 */
                pg = uvm_page_array_fill_and_peek(a, offset, nleft);
                if (pg != NULL && pg->offset != offset) {
+                       struct vm_page __diagused *tpg;
                        KASSERT(
                            ((a->ar_flags & UVM_PAGE_ARRAY_FILL_BACKWARD) != 0)
                            == (pg->offset < offset));
-                       KASSERT(uvm_pagelookup(uobj, offset) == NULL ||
+                       KASSERT((tpg = uvm_pagelookup(uobj, offset)) == NULL ||
                                ((a->ar_flags & UVM_PAGE_ARRAY_FILL_DIRTY) != 0 &&
-                                !uvm_obj_page_dirty_p(pg)));
+                                !uvm_obj_page_dirty_p(tpg)));
                        pg = NULL;
                        if ((a->ar_flags & UVM_PAGE_ARRAY_FILL_DENSE) != 0) {
                                UVMHIST_LOG(ubchist, "dense", 0,0,0,0);



Home | Main Index | Thread Index | Old Index