summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2006-10-14 23:21:48 +0000
committeralc <alc@FreeBSD.org>2006-10-14 23:21:48 +0000
commit31fbaf5d5c4fee7ed738e969e382411caf2e603f (patch)
tree235ce5aff58408af0304d89227903fae4f74fa37 /sys/vm
parent07a6c3ab4ed79dd790146ab334bbd17a33f1770d (diff)
downloadFreeBSD-src-31fbaf5d5c4fee7ed738e969e382411caf2e603f.zip
FreeBSD-src-31fbaf5d5c4fee7ed738e969e382411caf2e603f.tar.gz
Long ago, revision 1.22 of vm/vm_pager.h introduced a bug. Specifically,
it introduced a check after the call to file system's get pages method that assumes that the get pages method does not change the array of pages that is passed to it. In the case of vnode_pager_generic_getpages(), this assumption has been incorrect. The contents of the array of pages may be shifted by vnode_pager_generic_getpages(). Likely, the problem has been hidden by vnode_pager_haspage() limiting the set of pages that are passed to vnode_pager_generic_getpages() such that a shift never occurs. The fix implemented herein is to adjust the pointer to the array of pages rather than shifting the pages within the array. MFC after: 3 weeks Fix suggested by: tegge
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vnode_pager.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index e6b88cd..cb4cc39 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -857,9 +857,7 @@ vnode_pager_generic_getpages(vp, m, bytecount, reqpage)
* to be zero based...
*/
if (first != 0) {
- for (i = first; i < count; i++) {
- m[i - first] = m[i];
- }
+ m += first;
count -= first;
reqpage -= first;
}
OpenPOWER on IntegriCloud