mirror of
https://github.com/reactos/reactos.git
synced 2025-05-08 03:07:05 +00:00
[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:
parent
cf8ba3bd9c
commit
1acb5a9fab
1 changed files with 3 additions and 1 deletions
|
@ -385,6 +385,8 @@ CcPinRead (
|
||||||
iBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, TRUE);
|
iBcb = CcpFindBcb(SharedCacheMap, FileOffset, Length, TRUE);
|
||||||
if (iBcb != NULL)
|
if (iBcb != NULL)
|
||||||
{
|
{
|
||||||
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
||||||
|
|
||||||
/* Free our now unused BCB */
|
/* Free our now unused BCB */
|
||||||
CcUnpinData(*Bcb);
|
CcUnpinData(*Bcb);
|
||||||
|
|
||||||
|
@ -414,8 +416,8 @@ CcPinRead (
|
||||||
|
|
||||||
/* Insert ourselves in the linked list */
|
/* Insert ourselves in the linked list */
|
||||||
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
InsertTailList(&SharedCacheMap->BcbList, &iBcb->BcbEntry);
|
||||||
|
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
||||||
}
|
}
|
||||||
KeReleaseSpinLock(&SharedCacheMap->BcbSpinLock, OldIrql);
|
|
||||||
}
|
}
|
||||||
/* We found a BCB, lock it and return it */
|
/* We found a BCB, lock it and return it */
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue