https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2362e0faae65397fb50c7…
commit 2362e0faae65397fb50c7072f83a8b5f8cfe2282
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Thu Jan 25 21:56:19 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Thu Jan 25 22:00:20 2018 +0100
[NTOSKRNL] Allow pinned dirty VACB to be lazy written.
This is an addition to 07e6e9c.
Also, fix a cppcheck warning (so minor!).
CORE-14249
---
ntoskrnl/cc/view.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/cc/view.c b/ntoskrnl/cc/view.c
index 6f4457f5bf..e8da9a51c8 100644
--- a/ntoskrnl/cc/view.c
+++ b/ntoskrnl/cc/view.c
@@ -250,7 +250,8 @@ CcRosFlushDirtyPages (
ASSERT(current->Dirty);
/* One reference is added above */
- if (current->ReferenceCount > 2)
+ if ((current->ReferenceCount > 2 && current->PinCount == 0) ||
+ (current->ReferenceCount > 3 && current->PinCount > 1))
{
CcRosReleaseVacbLock(current);
current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite(
@@ -883,7 +884,7 @@ CcRosCreateVacb (
#if MI_TRACE_PFNS
if ((SharedCacheMap->FileObject) &&
(SharedCacheMap->FileObject->FileName.Buffer))
{
- PWCHAR pos = NULL;
+ PWCHAR pos;
ULONG len = 0;
pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\');
if (pos)