Fix vm object creation locking to allow SHARED vnode locking for vnode_create_vobject.
(Not currently used) Noticed by: kib@
This commit is contained in:
parent
d3532631de
commit
11be8415c9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179765
@ -225,20 +225,21 @@ vnode_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot,
|
||||
object->handle = handle;
|
||||
if (VFS_NEEDSGIANT(vp->v_mount))
|
||||
vm_object_set_flag(object, OBJ_NEEDGIANT);
|
||||
VM_OBJECT_LOCK(object);
|
||||
if ( vp->v_object != NULL) {
|
||||
VI_LOCK(vp);
|
||||
if (vp->v_object != NULL) {
|
||||
/*
|
||||
* Object has been created while we were sleeping
|
||||
*/
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
VI_UNLOCK(vp);
|
||||
vm_object_destroy(object);
|
||||
goto retry;
|
||||
}
|
||||
vp->v_object = object;
|
||||
} else
|
||||
VI_UNLOCK(vp);
|
||||
} else {
|
||||
object->ref_count++;
|
||||
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
VM_OBJECT_UNLOCK(object);
|
||||
}
|
||||
vref(vp);
|
||||
return (object);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user