From: Pierre Schweitzer Date: Sun, 4 Jun 2017 08:02:01 +0000 (+0000) Subject: [UDFS] X-Git-Tag: ReactOS-0.4.6~431 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=0978c888bd0c58893c032cec7a97f6dea60c79b3 [UDFS] lolfix some deadlocks in UDFS: - deadlock when enumerating files - deadlock on shutdown after volume change I could track it to the fact that for whatever reason, GCC wrongly optimize the BOOLEAN used to store whether the VCB resource was acquired. The optimization being to assume it's always FALSE. Thus, the resource is never released and the driver ends in a deadlock. To avoid this: marked the BOOLEAN variables as volatile. I guess there are same kind deadlocks I couldn't see in my limited tests... CORE-4375 svn path=/trunk/; revision=74897 --- diff --git a/reactos/drivers/filesystems/udfs/close.cpp b/reactos/drivers/filesystems/udfs/close.cpp index fe4dfc976d9..c35528027cf 100644 --- a/reactos/drivers/filesystems/udfs/close.cpp +++ b/reactos/drivers/filesystems/udfs/close.cpp @@ -1109,7 +1109,7 @@ UDFQueueDelayedClose( { PtrUDFIrpContextLite IrpContextLite; BOOLEAN StartWorker = FALSE; - BOOLEAN AcquiredVcb = FALSE; + volatile BOOLEAN AcquiredVcb = FALSE; NTSTATUS RC; AdPrint((" UDFQueueDelayedClose\n")); diff --git a/reactos/drivers/filesystems/udfs/create.cpp b/reactos/drivers/filesystems/udfs/create.cpp index 0928ff1e57a..4f2f848cd64 100644 --- a/reactos/drivers/filesystems/udfs/create.cpp +++ b/reactos/drivers/filesystems/udfs/create.cpp @@ -205,7 +205,7 @@ UDFCommonCreate( PACCESS_STATE AccessState; PVCB Vcb = NULL; - BOOLEAN AcquiredVcb = FALSE; + volatile BOOLEAN AcquiredVcb = FALSE; BOOLEAN OpenExisting = FALSE; PERESOURCE Res1 = NULL; PERESOURCE Res2 = NULL;