[ros-diffs] [arty] 44277: Prevent deadlock by purging the cache (with delete) in CcUninitializeCacheMap.

arty at svn.reactos.org arty at svn.reactos.org
Tue Nov 24 00:43:17 CET 2009


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/cachesub.c?rev=44277&r1=44276&r2=44277&view=diff
==============================================================================
--- 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.c?rev=44277&r1=44276&r2=44277&view=diff
==============================================================================
--- 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)
 	{




More information about the Ros-diffs mailing list