Fix assertion that checks that pages are consecutive to properly
handle bogus_page insertion(s).
This commit is contained in:
parent
bfc8c24c73
commit
1e0c121f3a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311338
@ -974,10 +974,14 @@ vnode_pager_generic_getpages(struct vnode *vp, vm_page_t *m, int count,
|
||||
#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
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user