[NTOSKRNL] Don't keep the spin lock hold too long when we lost the BCB race

This will avoid a deadlock on unpin.
This commit is contained in:
Pierre Schweitzer 2018-10-12 08:20:32 +02:00
parent cf8ba3bd9c
commit 1acb5a9fab
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -385,6 +385,8 @@ CcPinRead (
iBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, TRUE);
if (iBcb != NULL)
{
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
/* Free our now unused BCB */
CcUnpinData(*Bcb);
@ -414,8 +416,8 @@ CcPinRead (
/* Insert ourselves in the linked list */
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
}
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
}
/* We found a BCB, lock it and return it */
else