When transferring the page from one object to another, don't insert the

page into its new object until the page's pindex has been updated.
Otherwise, one code path within vm_radix_insert() may use the wrong
pindex value.

Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
alc 2013-03-12 06:14:31 +00:00
parent 65dfab2053
commit 07fc599921

View File

@ -1110,10 +1110,10 @@ vm_page_cache_transfer(vm_object_t orig_object, vm_pindex_t offidxstart,
if ((m->pindex - offidxstart) >= new_object->size)
break;
vm_radix_remove(&orig_object->cache, m->pindex);
vm_radix_insert(&new_object->cache, m->pindex - offidxstart, m);
/* Update the page's object and offset. */
m->object = new_object;
m->pindex -= offidxstart;
vm_radix_insert(&new_object->cache, m->pindex, m);
}
mtx_unlock(&vm_page_queue_free_mtx);
}