diff --git a/drivers/filesystems/fastfat/close.c b/drivers/filesystems/fastfat/close.c index 0c313e6629b..d8f85a85a43 100644 --- a/drivers/filesystems/fastfat/close.c +++ b/drivers/filesystems/fastfat/close.c @@ -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); } diff --git a/drivers/filesystems/fastfat/iface.c b/drivers/filesystems/fastfat/iface.c index e99409c6695..c98e64f02bd 100644 --- a/drivers/filesystems/fastfat/iface.c +++ b/drivers/filesystems/fastfat/iface.c @@ -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) { diff --git a/drivers/filesystems/fastfat/shutdown.c b/drivers/filesystems/fastfat/shutdown.c index c363aefa166..c9e2bd5431d 100644 --- a/drivers/filesystems/fastfat/shutdown.c +++ b/drivers/filesystems/fastfat/shutdown.c @@ -61,6 +61,7 @@ VfatShutdown( FsRtlEnterFileSystem(); /* FIXME: block new mount requests */ + VfatGlobalData->ShutdownStarted = TRUE; if (DeviceObject == VfatGlobalData->DeviceObject) { diff --git a/drivers/filesystems/fastfat/vfat.h b/drivers/filesystems/fastfat/vfat.h index 834427e1b85..993d5f9fb93 100644 --- a/drivers/filesystems/fastfat/vfat.h +++ b/drivers/filesystems/fastfat/vfat.h @@ -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;