Call VfatSetAllocationSizeInformation only if the file size is increased (VfatWrite).

svn path=/trunk/; revision=3357
This commit is contained in:
Hartmut Birr 2002-08-17 16:51:07 +00:00
parent 85acea80c6
commit 7376639aea

View file

@ -1,5 +1,5 @@
/* $Id: rw.c,v 1.45 2002/08/17 15:15:50 hbirr Exp $ /* $Id: rw.c,v 1.46 2002/08/17 16:51:07 hbirr Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -930,13 +930,14 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext)
OldFileSize = Fcb->RFCB.FileSize; OldFileSize = Fcb->RFCB.FileSize;
OldAllocationSize = Fcb->RFCB.AllocationSize.u.LowPart; OldAllocationSize = Fcb->RFCB.AllocationSize.u.LowPart;
if (!(Fcb->Flags & (FCB_IS_FAT|FCB_IS_VOLUME)) && !(IrpContext->Irp->Flags & IRP_PAGING_IO)) if (!(Fcb->Flags & (FCB_IS_FAT|FCB_IS_VOLUME)) &&
!(IrpContext->Irp->Flags & IRP_PAGING_IO) &&
ByteOffset.u.LowPart + Length > Fcb->RFCB.FileSize.u.LowPart)
{ {
LARGE_INTEGER AllocationSize; LARGE_INTEGER AllocationSize;
AllocationSize.QuadPart = ByteOffset.u.LowPart + Length; AllocationSize.QuadPart = ByteOffset.u.LowPart + Length;
Status = VfatSetAllocationSizeInformation(IrpContext->FileObject, Fcb, Status = VfatSetAllocationSizeInformation(IrpContext->FileObject, Fcb,
IrpContext->DeviceExt, &AllocationSize); IrpContext->DeviceExt, &AllocationSize);
CHECKPOINT;
if (!NT_SUCCESS (Status)) if (!NT_SUCCESS (Status))
{ {
CHECKPOINT; CHECKPOINT;