[NTOSKRNL] Honor files that shouldn't be lazy written
authorPierre Schweitzer <pierre@reactos.org>
Sun, 23 Dec 2018 11:10:58 +0000 (12:10 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 23 Dec 2018 11:10:58 +0000 (12:10 +0100)
ntoskrnl/cc/view.c

index d644965..890c75e 100644 (file)
@@ -222,6 +222,14 @@ CcRosFlushDirtyPages (
             continue;
         }
 
+        /* Don't attempt to lazy write the files that asked not to */
+        if (CalledFromLazy &&
+            BooleanFlagOn(current->SharedCacheMap->Flags, WRITEBEHIND_DISABLED))
+        {
+            CcRosVacbDecRefCount(current);
+            continue;
+        }
+
         ASSERT(current->Dirty);
 
         KeReleaseQueuedSpinLock(LockQueueMasterLock, OldIrql);