diff --git a/drivers/filesystems/fastfat/fcb.c b/drivers/filesystems/fastfat/fcb.c
index 4a103b0..97600ae 100644
--- a/drivers/filesystems/fastfat/fcb.c
+++ b/drivers/filesystems/fastfat/fcb.c
@@ -310,20 +310,38 @@ vfatReleaseFCB(
 
     while (pFCB)
     {
+        ULONG RefCount;
+
         ASSERT(pFCB != pVCB->VolumeFcb);
         ASSERT(pFCB->RefCount > 0);
-        pFCB->RefCount--;
-        if (pFCB->RefCount == 0)
+        RefCount = --pFCB->RefCount;
+
+        if (RefCount == 1 && vfatFCBIsDirectory(pFCB))
+        {
+            if (pFCB->FileObject != NULL &&
+                pFCB->FileObject->SectionObjectPointer != NULL)
+            {
+                CcUninitializeCacheMap(pFCB->FileObject, NULL, NULL);
+                ObDereferenceObject(pFCB->FileObject);
+                pFCB->FileObject = NULL;
+            }
+        }
+
+        tmpFcb = NULL;
+
+        if (RefCount == 0)
         {
             ASSERT(pFCB->OpenHandleCount == 0);
-            tmpFcb = pFCB->parentFcb;
+
+            if (!vfatFCBIsDirectory(pFCB))
+            {
+                tmpFcb = pFCB->parentFcb;
+            }
+
             vfatDelFCBFromTable(pVCB, pFCB);
             vfatDestroyFCB(pFCB);
         }
-        else
-        {
-            tmpFcb = NULL;
-        }
+
         pFCB = tmpFcb;
     }
 }
