Extend the scope of the vm object lock in swp_pager_async_iodone() to cover

a vm_page_free().
This commit is contained in:
Alan Cox 2003-06-13 06:17:42 +00:00
parent 8630c1173e
commit 33a609ece0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116280

View file

@ -1485,8 +1485,6 @@ swp_pager_async_iodone(bp)
/*
* set object, raise to splvm().
*/
if (bp->b_npages)
object = bp->b_pages[0]->object;
s = splvm();
/*
@ -1494,6 +1492,10 @@ swp_pager_async_iodone(bp)
*/
pmap_qremove((vm_offset_t)bp->b_data, bp->b_npages);
if (bp->b_npages) {
object = bp->b_pages[0]->object;
VM_OBJECT_LOCK(object);
}
vm_page_lock_queues();
/*
* cleanup pages. If an error occurs writing to swap, we are in
@ -1620,7 +1622,6 @@ swp_pager_async_iodone(bp)
* pip refs on the object.
*/
if (object != NULL) {
VM_OBJECT_LOCK(object);
vm_object_pip_wakeupn(object, bp->b_npages);
VM_OBJECT_UNLOCK(object);
}