[NTFS]
authorPierre Schweitzer <pierre@reactos.org>
Tue, 23 Feb 2016 19:57:10 +0000 (19:57 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Tue, 23 Feb 2016 19:57:10 +0000 (19:57 +0000)
Moar locking

svn path=/trunk/; revision=70777

reactos/drivers/filesystems/ntfs/cleanup.c

index 4ac09f3..b822711 100644 (file)
@@ -106,7 +106,16 @@ NtfsCleanup(PNTFS_IRP_CONTEXT IrpContext)
     FileObject = IrpContext->FileObject;
     DeviceExtension = DeviceObject->DeviceExtension;
 
     FileObject = IrpContext->FileObject;
     DeviceExtension = DeviceObject->DeviceExtension;
 
+    if (!ExAcquireResourceExclusiveLite(&DeviceExtension->DirResource,
+                                        BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT)))
+    {
+        return NtfsMarkIrpContextForQueue(IrpContext);
+    }
+
     Status = NtfsCleanupFile(DeviceExtension, FileObject, BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT));
     Status = NtfsCleanupFile(DeviceExtension, FileObject, BooleanFlagOn(IrpContext->Flags, IRPCONTEXT_CANWAIT));
+
+    ExReleaseResourceLite(&DeviceExtension->DirResource);
+
     if (Status == STATUS_PENDING)
     {
         return NtfsMarkIrpContextForQueue(IrpContext);
     if (Status == STATUS_PENDING)
     {
         return NtfsMarkIrpContextForQueue(IrpContext);