mirror of
https://github.com/reactos/reactos.git
synced 2024-12-12 21:53:43 +08:00
[NTOSKRNL] On file cache deletion, only manipulate VACB once locked.
Should help avoiding race conditions with lazy write. CORE-14263
This commit is contained in:
parent
3889d8309a
commit
78664ebe15
@ -528,7 +528,7 @@ CcRosReleaseVacb (
|
|||||||
WasDirty = FALSE;
|
WasDirty = FALSE;
|
||||||
if (Dirty)
|
if (Dirty)
|
||||||
{
|
{
|
||||||
if (!Vacb->Dirty && Dirty)
|
if (!Vacb->Dirty)
|
||||||
{
|
{
|
||||||
CcRosMarkDirtyVacb(Vacb);
|
CcRosMarkDirtyVacb(Vacb);
|
||||||
}
|
}
|
||||||
@ -658,7 +658,6 @@ CcRosMarkDirtyFile (
|
|||||||
|
|
||||||
CcRosMarkDirtyVacb(Vacb);
|
CcRosMarkDirtyVacb(Vacb);
|
||||||
|
|
||||||
|
|
||||||
CcRosReleaseVacbLock(Vacb);
|
CcRosReleaseVacbLock(Vacb);
|
||||||
|
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
@ -688,7 +687,7 @@ CcRosUnmapVacb (
|
|||||||
WasDirty = FALSE;
|
WasDirty = FALSE;
|
||||||
if (NowDirty)
|
if (NowDirty)
|
||||||
{
|
{
|
||||||
if (!Vacb->Dirty && NowDirty)
|
if (!Vacb->Dirty)
|
||||||
{
|
{
|
||||||
CcRosMarkDirtyVacb(Vacb);
|
CcRosMarkDirtyVacb(Vacb);
|
||||||
}
|
}
|
||||||
@ -1154,7 +1153,10 @@ CcRosDeleteFileCache (
|
|||||||
while (!IsListEmpty(&SharedCacheMap->CacheMapVacbListHead))
|
while (!IsListEmpty(&SharedCacheMap->CacheMapVacbListHead))
|
||||||
{
|
{
|
||||||
current_entry = RemoveTailList(&SharedCacheMap->CacheMapVacbListHead);
|
current_entry = RemoveTailList(&SharedCacheMap->CacheMapVacbListHead);
|
||||||
|
KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql);
|
||||||
|
|
||||||
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
|
current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry);
|
||||||
|
CcRosAcquireVacbLock(current, NULL);
|
||||||
RemoveEntryList(¤t->VacbLruListEntry);
|
RemoveEntryList(¤t->VacbLruListEntry);
|
||||||
if (current->Dirty)
|
if (current->Dirty)
|
||||||
{
|
{
|
||||||
@ -1164,6 +1166,9 @@ CcRosDeleteFileCache (
|
|||||||
DPRINT1("Freeing dirty VACB\n");
|
DPRINT1("Freeing dirty VACB\n");
|
||||||
}
|
}
|
||||||
InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
|
InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry);
|
||||||
|
CcRosReleaseVacbLock(current);
|
||||||
|
|
||||||
|
KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql);
|
||||||
}
|
}
|
||||||
#if DBG
|
#if DBG
|
||||||
SharedCacheMap->Trace = FALSE;
|
SharedCacheMap->Trace = FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user