Author: arty Date: Tue Nov 24 00:43:16 2009 New Revision: 44277
URL: http://svn.reactos.org/svn/reactos?rev=44277&view=rev Log: Prevent deadlock by purging the cache (with delete) in CcUninitializeCacheMap.
Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c branches/arty-newcc/ntoskrnl/cache/fssup.c
Modified: branches/arty-newcc/ntoskrnl/cache/cachesub.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/caches... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/cachesub.c [iso-8859-1] Tue Nov 24 00:43:16 2009 @@ -176,7 +176,7 @@ Bcb->Dirty = FALSE; ListEntry = ListEntry->Flink; - if (Delete && Bcb->RefCount == 2) + if (Delete && Bcb->RefCount < 2) { Bcb->RefCount = 1; CcpDereferenceCache(Bcb - CcCacheSections, FALSE);
Modified: branches/arty-newcc/ntoskrnl/cache/fssup.c URL: http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/cache/fssup.... ============================================================================== --- branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] (original) +++ branches/arty-newcc/ntoskrnl/cache/fssup.c [iso-8859-1] Tue Nov 24 00:43:16 2009 @@ -160,6 +160,9 @@
ASSERT(UninitializeEvent == NULL);
+ if (Map) + CcpFlushCache(Map, NULL, 0, NULL, TRUE); + CcpLock(); if (PrivateCacheMap) {