[FASTFAT] Don't delay any other close once shutdown has started

This commit is contained in:
Pierre Schweitzer 2018-08-19 09:55:38 +02:00
parent 4fe7aafe10
commit 901c47ed14
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B
4 changed files with 5 additions and 1 deletions

View 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);
}

View 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)
{

View file

@ -61,6 +61,7 @@ VfatShutdown(
FsRtlEnterFileSystem();
/* FIXME: block new mount requests */
VfatGlobalData->ShutdownStarted = TRUE;
if (DeviceObject == VfatGlobalData->DeviceObject)
{

View 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;