[NTOS:CC] Acquire the master lock after freeing the VACB in CcRosFlushDirtyPages

Fixes a random ASSERT
This commit is contained in:
Jérôme Gardou 2020-12-09 18:05:07 +01:00
parent b089903520
commit 8631e75837

View File

@ -244,8 +244,12 @@ CcRosFlushDirtyPages (
current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
current->SharedCacheMap->LazyWriteContext);
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
/* We release the VACB before acquiring the lock again, because
* CcRosVacbDecRefCount might free the VACB, as CcRosFlushVacb dropped a
* Refcount. Freeing must be done outside of the lock.
* The refcount is decremented atomically. So this is OK. */
CcRosVacbDecRefCount(current);
OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE) &&
(Status != STATUS_MEDIA_WRITE_PROTECTED))