[0.4.9] cherry-pick [FASTFAT] Lock DirResource on flush in case we're updating entry

CORE-14660

(cherry picked from commit 9f3169b295)
This commit is contained in:
Pierre Schweitzer 2018-05-28 09:01:39 +02:00 committed by Joachim Henze
parent ae5aa9cd8b
commit 98e87bcafd

View 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;
}