Date: Wed, 4 Jan 2017 22:31:10 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311338 - head/sys/vm Message-ID: <201701042231.v04MVAdc029718@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Jan 4 22:31:09 2017 New Revision: 311338 URL: https://svnweb.freebsd.org/changeset/base/311338 Log: Fix assertion that checks that pages are consecutive to properly handle bogus_page insertion(s). Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Wed Jan 4 22:29:00 2017 (r311337) +++ head/sys/vm/vnode_pager.c Wed Jan 4 22:31:09 2017 (r311338) @@ -974,10 +974,14 @@ vnode_pager_generic_getpages(struct vnod #ifdef INVARIANTS KASSERT(bp->b_npages <= nitems(bp->b_pages), ("%s: buf %p overflowed", __func__, bp)); - for (int j = 1; j < bp->b_npages; j++) - KASSERT(bp->b_pages[j]->pindex - 1 == - bp->b_pages[j - 1]->pindex, - ("%s: pages array not consecutive, bp %p", __func__, bp)); + for (int j = 1, prev = 1; j < bp->b_npages; j++) { + if (bp->b_pages[j] == bogus_page) + continue; + KASSERT(bp->b_pages[j]->pindex - bp->b_pages[prev]->pindex == + j - prev, ("%s: pages array not consecutive, bp %p", + __func__, bp)); + prev = j; + } #endif /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701042231.v04MVAdc029718>