Author: tfaber
Date: Tue Aug  9 07:59:07 2016
New Revision: 72164

URL: http://svn.reactos.org/svn/reactos?rev=72164&view=rev
Log:
[NTOS:CC]
- Gracefully handle failure to obtain virtual memory when creating a VACB. We 
now no longer crash when running out of virtual memory during (large) file 
operations (but will still crash when running out of physical memory).
CORE-11533

Modified:
    trunk/reactos/ntoskrnl/cc/view.c

Modified: trunk/reactos/ntoskrnl/cc/view.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cc/view.c?rev=72164&r1=72163&r2=72164&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/cc/view.c    [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cc/view.c    [iso-8859-1] Tue Aug  9 07:59:07 2016
@@ -594,7 +594,8 @@
     MmUnlockAddressSpace(MmGetKernelAddressSpace());
     if (!NT_SUCCESS(Status))
     {
-        KeBugCheck(CACHE_MANAGER);
+        DPRINT1("MmCreateMemoryArea failed with %lx for VACB %p\n", Status, 
Vacb);
+        return Status;
     }
 
     ASSERT(((ULONG_PTR)Vacb->BaseAddress % PAGE_SIZE) == 0);
@@ -746,6 +747,13 @@
 #endif
 
     Status = CcRosMapVacb(current);
+    if (!NT_SUCCESS(Status))
+    {
+        RemoveEntryList(&current->CacheMapVacbListEntry);
+        RemoveEntryList(&current->VacbLruListEntry);
+        CcRosReleaseVacbLock(current);
+        ExFreeToNPagedLookasideList(&VacbLookasideList, current);
+    }
 
     return Status;
 }


Reply via email to