VMCache::RemoveArea(): Don't release the store reference while having
the cache locked, since it enters the VFS and might reenter VMCache, thus causing deadlocks. Fixes bug #2577. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26849 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -667,6 +667,12 @@ VMCache::RemoveArea(vm_area* area)
|
|||||||
|
|
||||||
T(RemoveArea(this, area));
|
T(RemoveArea(this, area));
|
||||||
|
|
||||||
|
// We release the store reference first, since otherwise we would reverse
|
||||||
|
// the locking order or even deadlock ourselves (... -> free_vnode() -> ...
|
||||||
|
// -> bfs_remove_vnode() -> ... -> file_cache_set_size() -> mutex_lock()).
|
||||||
|
// Also cf. _RemoveConsumer().
|
||||||
|
ReleaseStoreRef();
|
||||||
|
|
||||||
AutoLocker<VMCache> locker(this);
|
AutoLocker<VMCache> locker(this);
|
||||||
|
|
||||||
if (area->cache_prev)
|
if (area->cache_prev)
|
||||||
@@ -676,8 +682,6 @@ VMCache::RemoveArea(vm_area* area)
|
|||||||
if (areas == area)
|
if (areas == area)
|
||||||
areas = area->cache_next;
|
areas = area->cache_next;
|
||||||
|
|
||||||
ReleaseStoreRef();
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user