[FASTFAT]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 12 Feb 2017 19:31:31 +0000 (19:31 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 12 Feb 2017 19:31:31 +0000 (19:31 +0000)
Don't attempt to verify volume if it was already verified in between

svn path=/trunk/; revision=73784

reactos/drivers/filesystems/fastfat/fsctl.c

index bb455c0..2076a65 100644 (file)
@@ -623,13 +623,21 @@ VfatVerify(
     BOOLEAN RecognizedFS;
     PDEVICE_EXTENSION DeviceExt;
     BOOLEAN AllowRaw;
+    PVPB Vpb;
 
     DPRINT("VfatVerify(IrpContext %p)\n", IrpContext);
 
     DeviceToVerify = IrpContext->Stack->Parameters.VerifyVolume.DeviceObject;
     DeviceExt = DeviceToVerify->DeviceExtension;
+    Vpb = IrpContext->Stack->Parameters.VerifyVolume.Vpb;
     AllowRaw = BooleanFlagOn(IrpContext->Stack->Flags, SL_ALLOW_RAW_MOUNT);
 
+    if (!BooleanFlagOn(Vpb->RealDevice->Flags, DO_VERIFY_VOLUME))
+    {
+        DPRINT("Already verified\n");
+        return STATUS_SUCCESS;
+    }
+
     Status = VfatBlockDeviceIoControl(DeviceExt->StorageDevice,
                                       IOCTL_DISK_CHECK_VERIFY,
                                       NULL,
@@ -671,7 +679,7 @@ VfatVerify(
         }
     }
 
-    IrpContext->Stack->Parameters.VerifyVolume.Vpb->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
+    Vpb->RealDevice->Flags &= ~DO_VERIFY_VOLUME;
 
     return Status;
 }