mirror of
https://github.com/reactos/reactos.git
synced 2025-05-06 18:31:26 +00:00
[NTOSKRNL] Fix a ****ing bug where private cache map was deleted in CcUninitializeCacheMap()
before the call to CcRosReleaseFileCache() which expects to have it to properly clean the file. So, move deletion code to CcRosReleaseFileCache() so that he's the only one to handle private map. Should hopefully fix all the recent buildbots issues (and the universe perhaps, who knows?)
This commit is contained in:
parent
f8b5d27807
commit
f0c7f862d4
2 changed files with 14 additions and 19 deletions
|
@ -346,25 +346,6 @@ CcUninitializeCacheMap (
|
|||
FALSE);
|
||||
}
|
||||
|
||||
/* Closing the handle, so kill the private cache map */
|
||||
if (FileObject->SectionObjectPointer->SharedCacheMap != NULL &&
|
||||
FileObject->PrivateCacheMap != NULL)
|
||||
{
|
||||
PPRIVATE_CACHE_MAP PrivateMap;
|
||||
|
||||
PrivateMap = FileObject->PrivateCacheMap;
|
||||
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||
|
||||
/* Remove it from the file */
|
||||
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &OldIrql);
|
||||
RemoveEntryList(&PrivateMap->PrivateLinks);
|
||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, OldIrql);
|
||||
|
||||
/* And free it */
|
||||
FileObject->PrivateCacheMap = NULL;
|
||||
ExFreePoolWithTag(PrivateMap, TAG_PRIVATE_CACHE_MAP);
|
||||
}
|
||||
|
||||
Status = CcRosReleaseFileCache(FileObject);
|
||||
if (UninitializeCompleteEvent)
|
||||
{
|
||||
|
|
|
@ -1180,7 +1180,21 @@ CcRosReleaseFileCache (
|
|||
SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap;
|
||||
if (FileObject->PrivateCacheMap != NULL)
|
||||
{
|
||||
KIRQL OldIrql;
|
||||
PPRIVATE_CACHE_MAP PrivateMap;
|
||||
|
||||
/* Closing the handle, so kill the private cache map */
|
||||
PrivateMap = FileObject->PrivateCacheMap;
|
||||
|
||||
/* Remove it from the file */
|
||||
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &OldIrql);
|
||||
RemoveEntryList(&PrivateMap->PrivateLinks);
|
||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, OldIrql);
|
||||
|
||||
/* And free it */
|
||||
FileObject->PrivateCacheMap = NULL;
|
||||
ExFreePoolWithTag(PrivateMap, TAG_PRIVATE_CACHE_MAP);
|
||||
|
||||
if (SharedCacheMap->OpenCount > 0)
|
||||
{
|
||||
SharedCacheMap->OpenCount--;
|
||||
|
|
Loading…
Reference in a new issue