https://git.reactos.org/?p=reactos.git;a=commitdiff;h=901c47ed1405fd7fc2c31…
commit 901c47ed1405fd7fc2c31f54e6dc65ec2fb0728e
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Aug 19 09:55:38 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Sun Aug 19 09:56:12 2018 +0200
[FASTFAT] Don't delay any other close once shutdown has started
---
drivers/filesystems/fastfat/close.c | 3 ++-
drivers/filesystems/fastfat/iface.c | 1 +
drivers/filesystems/fastfat/shutdown.c | 1 +
drivers/filesystems/fastfat/vfat.h | 1 +
4 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/filesystems/fastfat/close.c b/drivers/filesystems/fastfat/close.c
index 0c313e6629..d8f85a85a4 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 e99409c669..c98e64f02b 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 c363aefa16..c9e2bd5431 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 834427e1b8..993d5f9fb9 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;