From 6bc24c2625bb0d2c486d36d6546c2ed983d14db5 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 1 Dec 2009 21:32:50 +0000 Subject: [PATCH] [ntoskrnl/cc] - Don't create zero sized cache segments. By Dmitry Gorbachev. See issue #4100 for more details. svn path=/trunk/; revision=44349 --- reactos/ntoskrnl/cc/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 30e07f0fb7d..8a943b763e9 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -166,7 +166,8 @@ CcSetFileSizes (IN PFILE_OBJECT FileObject, { current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); current_entry = current_entry->Flink; - if (current->FileOffset > FileSizes->AllocationSize.QuadPart) + if (current->FileOffset > FileSizes->AllocationSize.QuadPart || + (current->FileOffset == 0 && FileSizes->AllocationSize.QuadPart == 0)) { if (current->ReferenceCount == 0 || (current->ReferenceCount == 1 && current->Dirty)) {