[ros-diffs] [cgutman] 55057: [CDFS] - Prevent an infinite loop in CdfsDeviceIoControl if the the verify request is successful but IoCallDriver keeps returning STATUS_VERIFY_REQUIRED

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sat Jan 21 22:16:46 UTC 2012


Author: cgutman
Date: Sat Jan 21 22:16:46 2012
New Revision: 55057

URL: http://svn.reactos.org/svn/reactos?rev=55057&view=rev
Log:
[CDFS]
- Prevent an infinite loop in CdfsDeviceIoControl if the the verify request is successful but IoCallDriver keeps returning STATUS_VERIFY_REQUIRED

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=55057&r1=55056&r2=55057&view=diff
==============================================================================
--- trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/cdfs/common.c [iso-8859-1] Sat Jan 21 22:16:46 2012
@@ -154,6 +154,7 @@
     KEVENT Event;
     PIRP Irp;
     NTSTATUS Status;
+    BOOLEAN LastChance = FALSE;
 
     DPRINT("CdfsDeviceIoControl(DeviceObject %x, CtlCode %x, "
         "InputBuffer %x, InputBufferSize %x, OutputBuffer %x, "
@@ -208,20 +209,29 @@
     {
         PDEVICE_OBJECT DeviceToVerify;
 
-        DPRINT1("STATUS_VERIFY_REQUIRED\n");
         DeviceToVerify = IoGetDeviceToVerify(PsGetCurrentThread());
         IoSetDeviceToVerify(PsGetCurrentThread(), NULL);
 
         if (DeviceToVerify)
         {
             Status = IoVerifyVolume(DeviceToVerify, FALSE);
-            DPRINT1("IoVerifyVolume() returned (Status %lx)\n", Status);
-        }
-
-        if (NT_SUCCESS(Status))
+            DPRINT("IoVerifyVolume() returned (Status %lx)\n", Status);
+        }
+
+        if (NT_SUCCESS(Status) && !LastChance)
         {
             DPRINT1("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