summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2016-05-21 23:18:23 +0000
committeralc <alc@FreeBSD.org>2016-05-21 23:18:23 +0000
commit1bed8c54529b9e609e2408533614b7986d323e18 (patch)
treed1c36e8063198defc416611efe078b727a6c220b
parent27a317090771252c089acad12a67d26183eb1b5c (diff)
downloadFreeBSD-src-1bed8c54529b9e609e2408533614b7986d323e18.zip
FreeBSD-src-1bed8c54529b9e609e2408533614b7986d323e18.tar.gz
When descending a shadow chain of objects, it makes no sense to update
the current offset (spelled: "fs.pindex") until it is known whether a backing object exists. In fact, if not for the fact that the backing object offset is zero when there is no backing object, this update would produce a broken offset. Reviewed by: kib
-rw-r--r--sys/vm/vm_fault.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index e57654a..86e7f7b 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -705,7 +705,6 @@ vnode_locked:
* Move on to the next object. Lock the next object before
* unlocking the current one.
*/
- fs.pindex += OFF_TO_IDX(fs.object->backing_object_offset);
next_object = fs.object->backing_object;
if (next_object == NULL) {
/*
@@ -743,6 +742,8 @@ vnode_locked:
vm_object_pip_add(next_object, 1);
if (fs.object != fs.first_object)
vm_object_pip_wakeup(fs.object);
+ fs.pindex +=
+ OFF_TO_IDX(fs.object->backing_object_offset);
VM_OBJECT_WUNLOCK(fs.object);
fs.object = next_object;
}
OpenPOWER on IntegriCloud