Fix broken check for free disk space in NtfsAllocateClusters().

svn path=/branches/GSoC_2016/NTFS/; revision=71858
This commit is contained in:
Trevor Thompson 2016-07-08 12:05:19 +00:00 committed by Thomas Faber
parent 7a6e9bcdf6
commit de5cff4b37

View file

@ -162,8 +162,14 @@ NtfsAllocateClusters(PDEVICE_EXTENSION DeviceExt,
RtlInitializeBitMap(&Bitmap, (PULONG)BitmapData, DeviceExt->NtfsInfo.ClusterCount); RtlInitializeBitMap(&Bitmap, (PULONG)BitmapData, DeviceExt->NtfsInfo.ClusterCount);
FreeClusters = RtlNumberOfClearBits(&Bitmap); FreeClusters = RtlNumberOfClearBits(&Bitmap);
if( FreeClusters < DesiredClusters ) if (FreeClusters < DesiredClusters)
Status = STATUS_DISK_FULL; {
ReleaseAttributeContext(DataContext);
ExFreePoolWithTag(BitmapData, TAG_NTFS);
ExFreePoolWithTag(BitmapRecord, TAG_NTFS);
return STATUS_DISK_FULL;
}
// TODO: Observe MFT reservation zone // TODO: Observe MFT reservation zone