mirror of
https://github.com/reactos/reactos.git
synced 2024-06-30 18:01:07 +00:00
[NTOS:CC]
- Unconditionally acquire the VACB lock during map/pin/unpin operations and release it appropriately CORE-11555 #resolve CORE-11654 CORE-11504 CORE-11328 #comment This might be fixed with r71993. Could you retry please? svn path=/trunk/; revision=71993
This commit is contained in:
parent
45fe0d3a21
commit
5203dd99be
|
@ -185,10 +185,8 @@ CcPinRead (
|
|||
ASSERT(iBcb->Pinned == FALSE);
|
||||
|
||||
iBcb->Pinned = TRUE;
|
||||
if (InterlockedIncrement(&iBcb->Vacb->PinCount) == 1)
|
||||
{
|
||||
iBcb->Vacb->PinCount++;
|
||||
CcRosReleaseVacbLock(iBcb->Vacb);
|
||||
}
|
||||
|
||||
if (Flags & PIN_EXCLUSIVE)
|
||||
{
|
||||
|
@ -281,10 +279,8 @@ CcUnpinDataForThread (
|
|||
{
|
||||
ExReleaseResourceForThreadLite(&iBcb->Lock, ResourceThreadId);
|
||||
iBcb->Pinned = FALSE;
|
||||
if (InterlockedDecrement(&iBcb->Vacb->PinCount) == 0)
|
||||
{
|
||||
CcRosAcquireVacbLock(iBcb->Vacb, NULL);
|
||||
}
|
||||
iBcb->Vacb->PinCount--;
|
||||
}
|
||||
|
||||
CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap,
|
||||
|
@ -355,10 +351,8 @@ CcUnpinRepinnedBcb (
|
|||
{
|
||||
ExReleaseResourceLite(&iBcb->Lock);
|
||||
iBcb->Pinned = FALSE;
|
||||
if (InterlockedDecrement(&iBcb->Vacb->PinCount) == 0)
|
||||
{
|
||||
CcRosAcquireVacbLock(iBcb->Vacb, NULL);
|
||||
}
|
||||
iBcb->Vacb->PinCount--;
|
||||
}
|
||||
ExDeleteResourceLite(&iBcb->Lock);
|
||||
ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb);
|
||||
|
|
|
@ -422,10 +422,7 @@ CcRosReleaseVacb (
|
|||
|
||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
|
||||
KeReleaseGuardedMutex(&ViewLock);
|
||||
if (InterlockedCompareExchange(&Vacb->PinCount, 0, 0) == 0)
|
||||
{
|
||||
CcRosReleaseVacbLock(Vacb);
|
||||
}
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -462,10 +459,7 @@ CcRosLookupVacb (
|
|||
CcRosVacbIncRefCount(current);
|
||||
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
|
||||
KeReleaseGuardedMutex(&ViewLock);
|
||||
if (InterlockedCompareExchange(¤t->PinCount, 0, 0) == 0)
|
||||
{
|
||||
CcRosAcquireVacbLock(current, NULL);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
if (current->FileOffset.QuadPart > FileOffset)
|
||||
|
@ -712,10 +706,7 @@ CcRosCreateVacb (
|
|||
KeReleaseGuardedMutex(&ViewLock);
|
||||
ExFreeToNPagedLookasideList(&VacbLookasideList, *Vacb);
|
||||
*Vacb = current;
|
||||
if (InterlockedCompareExchange(¤t->PinCount, 0, 0) == 0)
|
||||
{
|
||||
CcRosAcquireVacbLock(current, NULL);
|
||||
}
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
if (current->FileOffset.QuadPart < FileOffset)
|
||||
|
@ -945,10 +936,7 @@ CcFlushCache (
|
|||
}
|
||||
}
|
||||
|
||||
if (InterlockedCompareExchange(¤t->PinCount, 0, 0) == 0)
|
||||
{
|
||||
CcRosReleaseVacbLock(current);
|
||||
}
|
||||
|
||||
KeAcquireGuardedMutex(&ViewLock);
|
||||
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
|
||||
|
|
|
@ -185,7 +185,8 @@ typedef struct _ROS_VACB
|
|||
/* Number of references. */
|
||||
ULONG ReferenceCount;
|
||||
/* How many times was it pinned? */
|
||||
volatile LONG PinCount;
|
||||
_Guarded_by_(Mutex)
|
||||
LONG PinCount;
|
||||
/* Pointer to the shared cache map for the file which this view maps data for. */
|
||||
PROS_SHARED_CACHE_MAP SharedCacheMap;
|
||||
/* Pointer to the next VACB in a chain. */
|
||||
|
|
Loading…
Reference in a new issue