[FASTFAT] Lock DirResource on flush in case we're updating entry
[reactos.git] / 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;
 }