[FASTFAT] Don't delay any other close once shutdown has started
authorPierre Schweitzer <pierre@reactos.org>
Sun, 19 Aug 2018 07:55:38 +0000 (09:55 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 19 Aug 2018 07:56:12 +0000 (09:56 +0200)
drivers/filesystems/fastfat/close.c
drivers/filesystems/fastfat/iface.c
drivers/filesystems/fastfat/shutdown.c
drivers/filesystems/fastfat/vfat.h

index 0c313e6..d8f85a8 100644 (file)
@@ -183,7 +183,8 @@ VfatCloseFile(
     }
 
     /* If we have to close immediately, or if delaying failed, close */
-    if (!BooleanFlagOn(pFcb->Flags, FCB_DELAYED_CLOSE) || !NT_SUCCESS(VfatPostCloseFile(DeviceExt, FileObject)))
+    if (VfatGlobalData->ShutdownStarted || !BooleanFlagOn(pFcb->Flags, FCB_DELAYED_CLOSE) ||
+        !NT_SUCCESS(VfatPostCloseFile(DeviceExt, FileObject)))
     {
         VfatCommonCloseFile(DeviceExt, pFcb);
     }
index e99409c..c98e64f 100644 (file)
@@ -101,6 +101,7 @@ DriverEntry(
     InitializeListHead(&VfatGlobalData->CloseListHead);
     VfatGlobalData->CloseCount = 0;
     VfatGlobalData->CloseWorkerRunning = FALSE;
+    VfatGlobalData->ShutdownStarted = FALSE;
     VfatGlobalData->CloseWorkItem = IoAllocateWorkItem(DeviceObject);
     if (VfatGlobalData->CloseWorkItem == NULL)
     {
index c363aef..c9e2bd5 100644 (file)
@@ -61,6 +61,7 @@ VfatShutdown(
     FsRtlEnterFileSystem();
 
     /* FIXME: block new mount requests */
+    VfatGlobalData->ShutdownStarted = TRUE;
 
     if (DeviceObject == VfatGlobalData->DeviceObject)
     {
index 834427e..993d5f9 100644 (file)
@@ -417,6 +417,7 @@ typedef struct
     LIST_ENTRY CloseListHead;
     BOOLEAN CloseWorkerRunning;
     PIO_WORKITEM CloseWorkItem;
+    BOOLEAN ShutdownStarted;
 } VFAT_GLOBAL_DATA, *PVFAT_GLOBAL_DATA;
 
 extern PVFAT_GLOBAL_DATA VfatGlobalData;