diff --git a/drivers/filesystems/fastfat/rw.c b/drivers/filesystems/fastfat/rw.c index 76ffff933c5..ad65628876a 100644 --- a/drivers/filesystems/fastfat/rw.c +++ b/drivers/filesystems/fastfat/rw.c @@ -1064,9 +1064,18 @@ VfatWrite( ByteOffset.u.LowPart + Length > Fcb->RFCB.FileSize.u.LowPart) { LARGE_INTEGER AllocationSize; + + if (!ExAcquireResourceExclusiveLite(&IrpContext->DeviceExt->DirResource, CanWait)) + { + goto ByeBye; + } + AllocationSize.QuadPart = ByteOffset.u.LowPart + Length; Status = VfatSetAllocationSizeInformation(IrpContext->FileObject, Fcb, IrpContext->DeviceExt, &AllocationSize); + + ExReleaseResourceLite(&IrpContext->DeviceExt->DirResource); + if (!NT_SUCCESS (Status)) { goto ByeBye;