Call VfatSetAllocationSizeInformation only if the file size is increased (VfatWrite).
authorHartmut Birr <osexpert@googlemail.com>
Sat, 17 Aug 2002 16:51:07 +0000 (16:51 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Sat, 17 Aug 2002 16:51:07 +0000 (16:51 +0000)
svn path=/trunk/; revision=3357

reactos/drivers/fs/vfat/rw.c

index c7fd438..fc899c8 100644 (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
  * PROJECT:          ReactOS kernel
  *
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS kernel
@@ -930,13 +930,14 @@ NTSTATUS VfatWrite (PVFAT_IRP_CONTEXT IrpContext)
    OldFileSize = Fcb->RFCB.FileSize;
    OldAllocationSize = Fcb->RFCB.AllocationSize.u.LowPart;
 
    OldFileSize = Fcb->RFCB.FileSize;
    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;
       AllocationSize.QuadPart = ByteOffset.u.LowPart + Length;
       Status = VfatSetAllocationSizeInformation(IrpContext->FileObject, Fcb,
                                                IrpContext->DeviceExt, &AllocationSize);
    {
       LARGE_INTEGER AllocationSize;
       AllocationSize.QuadPart = ByteOffset.u.LowPart + Length;
       Status = VfatSetAllocationSizeInformation(IrpContext->FileObject, Fcb,
                                                IrpContext->DeviceExt, &AllocationSize);
-      CHECKPOINT;
       if (!NT_SUCCESS (Status))
       {
          CHECKPOINT;
       if (!NT_SUCCESS (Status))
       {
          CHECKPOINT;