From: Pierre Schweitzer Date: Fri, 12 Oct 2018 06:20:32 +0000 (+0200) Subject: [NTOSKRNL] Don't keep the spin lock hold too long when we lost the BCB race X-Git-Tag: 0.4.12-dev~557 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=1acb5a9fab662f65a3be4fd319832edfe98cff6e;hp=cf8ba3bd9cb74870c64deb29ea44ac12245a4e92 [NTOSKRNL] Don't keep the spin lock hold too long when we lost the BCB race This will avoid a deadlock on unpin. --- diff --git a/ntoskrnl/cc/pin.c b/ntoskrnl/cc/pin.c index bba87960c3c..b3906a9321f 100644 --- a/ntoskrnl/cc/pin.c +++ b/ntoskrnl/cc/pin.c @@ -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