[UDFS]
authorPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 18:12:25 +0000 (18:12 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sat, 3 Jun 2017 18:12:25 +0000 (18:12 +0000)
HIde a bug in UDFQueueDelayedClose() by removing the boolean storing the fact
that VCB resource was (or not) acquired.
If you debug it, you see that in finally block, value is set to false on exit
without any reason: it is always acquired!
Given it's always acquired, just drop the boolean, but this doesn't explain the
root cause of this bug....

Here it helps avoiding deadlocks on directory listing on a DVD formatted with UDF

CORE-4375

svn path=/trunk/; revision=74780

reactos/drivers/filesystems/udfs/close.cpp

index 24db44b..74fa49e 100644 (file)
@@ -1109,7 +1109,6 @@ UDFQueueDelayedClose(
 {
     PtrUDFIrpContextLite    IrpContextLite;
     BOOLEAN                 StartWorker = FALSE;
-    BOOLEAN                 AcquiredVcb = FALSE;
     NTSTATUS                RC;
 
     AdPrint(("  UDFQueueDelayedClose\n"));
@@ -1119,7 +1118,6 @@ UDFQueueDelayedClose(
         UDFAcquireResourceExclusive(&(UDFGlobalData.DelayedCloseResource), TRUE);
 
         UDFAcquireResourceShared(&(Fcb->Vcb->VCBResource), TRUE);
-        AcquiredVcb = TRUE;
 
         if(Fcb->FCBFlags & UDF_FCB_DELETE_ON_CLOSE) {
             try_return(RC = STATUS_DELETE_PENDING);
@@ -1183,9 +1181,7 @@ try_exit:    NOTHING;
         if(!NT_SUCCESS(RC)) {
             Fcb->FCBFlags &= ~UDF_FCB_DELAY_CLOSE;
         }
-        if(AcquiredVcb) {
-            UDFReleaseResource(&(Fcb->Vcb->VCBResource));
-        }
+        UDFReleaseResource(&(Fcb->Vcb->VCBResource));
         // Release DelayedCloseResource
         UDFReleaseResource(&(UDFGlobalData.DelayedCloseResource));
     } _SEH2_END;