Fixed the range which must be zeroed if the write starts after the end of the file. Modified: branches/ext2/reactos/drivers/fs/ext2/src/write.c _____
Modified: branches/ext2/reactos/drivers/fs/ext2/src/write.c --- branches/ext2/reactos/drivers/fs/ext2/src/write.c 2005-01-20 23:21:14 UTC (rev 13172) +++ branches/ext2/reactos/drivers/fs/ext2/src/write.c 2005-01-20 23:24:51 UTC (rev 13173) @@ -544,7 +544,7 @@
LogicalBlockSize = EXT2_MIN_BLOCK_SIZE << PtrVCB->LogBlockSize; - if ( ByteOffset.QuadPart + WriteLength >= PtrReqdFCB->CommonFCBHeader.FileSize.QuadPart ) + if ( ByteOffset.QuadPart + WriteLength > PtrReqdFCB->CommonFCBHeader.FileSize.QuadPart ) { if( PagingIo ) { @@ -621,7 +621,7 @@
// Start offset is the New File size
StartOffsetForZeroing.QuadPart = - PtrReqdFCB->CommonFCBHeader.FileSize.QuadPart + WriteLength; + ByteOffset.QuadPart + WriteLength; // End offset is the New Allocation size
EndOffsetForZeroing.QuadPart = PtrReqdFCB->CommonFCBHeader.AllocationSize.QuadPart; }
IRC RELAY: Filip said that he had tested this driver on Windows and run some Hardware Compatibility Tests, and it worked fine. But he also said "some of the code paths aren't excercised on windows", so some bugs might be "hiding". Still i think its strange that it should take different paths on Ros than on Windows. It could also be that Windows is more forgiving to prog. errors in some cases.
Gunnar
hbirr@svn.reactos.com wrote:
Fixed the range which must be zeroed if the write starts after the end of the file.
Modified: branches/ext2/reactos/drivers/fs/ext2/src/write.c