Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112571279
D49200.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1005 B
Referenced Files
None
Subscribers
None
D49200.diff
View Options
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -1045,18 +1045,13 @@
vm_page_t mpred, p;
VM_OBJECT_WLOCK(object);
- startpindex = m[0]->pindex - rbehind;
- if ((mpred = TAILQ_PREV(m[0], pglist, listq)) != NULL &&
- mpred->pindex >= startpindex)
- startpindex = mpred->pindex + 1;
+ tpindex = m[0]->pindex;
+ startpindex = MAX(tpindex, rbehind) - rbehind;
+ if ((mpred = TAILQ_PREV(m[0], pglist, listq)) != NULL)
+ startpindex = MAX(startpindex, mpred->pindex + 1);
- /*
- * tpindex is unsigned; beware of numeric underflow.
- * Stepping backward from pindex, mpred doesn't change.
- */
- for (tpindex = m[0]->pindex - 1;
- tpindex >= startpindex && tpindex < m[0]->pindex;
- tpindex--, i++) {
+ /* Stepping backward from pindex, mpred doesn't change. */
+ for (; tpindex-- > startpindex; i++) {
p = vm_page_alloc_after(object, tpindex,
VM_ALLOC_NORMAL, mpred);
if (p == NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 11:58 PM (16 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16936828
Default Alt Text
D49200.diff (1005 B)
Attached To
Mode
D49200: vnode_pager: simplify loop, avoid overflow
Attached
Detach File
Event Timeline
Log In to Comment