Author: tthompson
Date: Fri Jul 8 12:05:19 2016
New Revision: 71858
URL:
http://svn.reactos.org/svn/reactos?rev=71858&view=rev
Log:
[NTFS]
Fix broken check for free disk space in NtfsAllocateClusters().
Modified:
branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c
Modified: branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2016/NTFS/drivers/filesyst…
==============================================================================
--- branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] (original)
+++ branches/GSoC_2016/NTFS/drivers/filesystems/ntfs/volinfo.c [iso-8859-1] Fri Jul 8
12:05:19 2016
@@ -162,8 +162,14 @@
RtlInitializeBitMap(&Bitmap, (PULONG)BitmapData,
DeviceExt->NtfsInfo.ClusterCount);
FreeClusters = RtlNumberOfClearBits(&Bitmap);
- if( FreeClusters < DesiredClusters )
- Status = STATUS_DISK_FULL;
+ if (FreeClusters < DesiredClusters)
+ {
+ ReleaseAttributeContext(DataContext);
+
+ ExFreePoolWithTag(BitmapData, TAG_NTFS);
+ ExFreePoolWithTag(BitmapRecord, TAG_NTFS);
+ return STATUS_DISK_FULL;
+ }
// TODO: Observe MFT reservation zone