[ros-diffs] [cgutman] 54750: [CDFS] - Fix infinite loop of verification and read attempts when a disc change occurs on VMware while ROS is running

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Dec 25 00:14:02 UTC 2011


Author: cgutman
Date: Sun Dec 25 00:14:01 2011
New Revision: 54750

URL: http://svn.reactos.org/svn/reactos?rev=54750&view=rev
Log:
[CDFS]
- Fix infinite loop of verification and read attempts when a disc change occurs on VMware while ROS is running

Modified:
    trunk/reactos/drivers/filesystems/cdfs/common.c

Modified: trunk/reactos/drivers/filesystems/cdfs/common.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/cdfs/common.c?rev=54750&r1=54749&r2=54750&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] Sun Dec 25 00:14:01 2011
@@ -49,6 +49,7 @@
     KEVENT Event;
     PIRP Irp;
     NTSTATUS Status;
+    BOOLEAN LastChance = FALSE;
 
 again:
     KeInitializeEvent(&Event,
@@ -104,17 +105,25 @@
         {
             PDEVICE_OBJECT DeviceToVerify;
 
-            DPRINT1("STATUS_VERIFY_REQUIRED\n");
             DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
             IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
 
             Status = IoVerifyVolume(DeviceToVerify, FALSE);
-            DPRINT1("IoVerifyVolume() returned (Status %lx)\n", Status);
-
-            if (NT_SUCCESS(Status))
+
+            if (NT_SUCCESS(Status) && !LastChance)
             {
-                DPRINT1("Volume verify succeeded; trying request again\n");
+                DPRINT("Volume verify succeeded; trying request again\n");
+                LastChance = TRUE;
                 goto again;
+            }
+            else if (NT_SUCCESS(Status))
+            {
+                DPRINT1("Failed to read after successful verify, aborting\n");
+                Status = STATUS_DEVICE_NOT_READY;
+            }
+            else
+            {
+                DPRINT1("IoVerifyVolume() failed (Status %lx)\n", Status);
             }
         }
 




More information about the Ros-diffs mailing list