svn commit: r311515 - stable/10/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Fri Jan 6 12:11:17 UTC 2017
Author: kib
Date: Fri Jan 6 12:11:16 2017
New Revision: 311515
URL: https://svnweb.freebsd.org/changeset/base/311515
Log:
MFC r310834:
Assert that the pages found on the object queue by vm_page_next() and
vm_page_prev() have correct ownership.
Modified:
stable/10/sys/vm/vm_page.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/vm/vm_page.c
==============================================================================
--- stable/10/sys/vm/vm_page.c Fri Jan 6 11:49:13 2017 (r311514)
+++ stable/10/sys/vm/vm_page.c Fri Jan 6 12:11:16 2017 (r311515)
@@ -1175,9 +1175,11 @@ vm_page_next(vm_page_t m)
vm_page_t next;
VM_OBJECT_ASSERT_WLOCKED(m->object);
- if ((next = TAILQ_NEXT(m, listq)) != NULL &&
- next->pindex != m->pindex + 1)
- next = NULL;
+ if ((next = TAILQ_NEXT(m, listq)) != NULL) {
+ MPASS(next->object == m->object);
+ if (next->pindex != m->pindex + 1)
+ next = NULL;
+ }
return (next);
}
@@ -1193,9 +1195,11 @@ vm_page_prev(vm_page_t m)
vm_page_t prev;
VM_OBJECT_ASSERT_WLOCKED(m->object);
- if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL &&
- prev->pindex != m->pindex - 1)
- prev = NULL;
+ if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL) {
+ MPASS(prev->object == m->object);
+ if (prev->pindex != m->pindex - 1)
+ prev = NULL;
+ }
return (prev);
}
More information about the svn-src-stable
mailing list