[FASTFAT] Lock DirResource on flush in case we're updating entry
authorPierre Schweitzer <pierre@reactos.org>
Mon, 28 May 2018 07:01:39 +0000 (09:01 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Mon, 28 May 2018 17:37:56 +0000 (19:37 +0200)
CORE-14660

drivers/filesystems/fastfat/flush.c

index ebf1925..22a8c6d 100644 (file)
@@ -33,6 +33,7 @@ VfatFlushFile(
         IoStatus.Status = STATUS_SUCCESS;
     }
 
+    ExAcquireResourceExclusiveLite(&DeviceExt->DirResource, TRUE);
     if (BooleanFlagOn(Fcb->Flags, FCB_IS_DIRTY))
     {
         Status = VfatUpdateEntry(DeviceExt, Fcb);
@@ -41,6 +42,8 @@ VfatFlushFile(
             IoStatus.Status = Status;
         }
     }
+    ExReleaseResourceLite(&DeviceExt->DirResource);
+
     return IoStatus.Status;
 }