https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6e4f83da700fbfac5450d…
commit 6e4f83da700fbfac5450dc9ef667585ddc870bc9
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Tue Feb 16 17:17:57 2021 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Wed Mar 24 15:28:04 2021 +0100
[NTOS:CC] Wake up lazy scan after inserting elements in the list.
---
ntoskrnl/cc/copy.c | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/ntoskrnl/cc/copy.c b/ntoskrnl/cc/copy.c
index 30864bc319e..09af125540c 100644
--- a/ntoskrnl/cc/copy.c
+++ b/ntoskrnl/cc/copy.c
@@ -381,16 +381,6 @@ CcCanIWrite (
return FALSE;
}
- /* Otherwise, if there are no deferred writes yet, start the lazy writer */
- if (IsListEmpty(&CcDeferredWrites))
- {
- KIRQL OldIrql;
-
- OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
- CcScheduleLazyWriteScan(TRUE);
- KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
- }
-
/* Initialize our wait event */
KeInitializeEvent(&WaitEvent, NotificationEvent, FALSE);
@@ -418,6 +408,12 @@ CcCanIWrite (
&CcDeferredWriteSpinLock);
}
+ /* Now make sure that the lazy scan writer will be active */
+ OldIrql = KeAcquireQueuedSpinLock(LockQueueMasterLock);
+ if (!LazyWriter.ScanActive)
+ CcScheduleLazyWriteScan(TRUE);
+ KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);
+
#if DBG
DPRINT1("Actively deferring write for: %p\n", FileObject);
DPRINT1("Because:\n");