mirror of
https://github.com/reactos/reactos.git
synced 2026-05-30 14:34:57 +08: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:
@@ -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--;
|
||||
|
||||
Reference in New Issue
Block a user