Fix assertion that checks that pages are consecutive to properly
handle bogus_page insertion(s).
This commit is contained in:
parent
01e1e94c27
commit
53ba35ff94
@ -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…
x
Reference in New Issue
Block a user