If we extend the file prior to defrring the write *and* the write
is set up FILE_WRITE_TO_END_OF_FILE then we have to convert the
FILE_WRITE_TO_END_OF_FILE to an absolute position since we have
already moved the FCB->Header.FileSize.
Change-Id: Ibe1a5d616490a3db152818cbd6bb24d5af251c5f
Reviewed-on: http://gerrit.openafs.org/11069
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
bReleaseSectionObject = TRUE;
if ( bWriteToEndOfFile)
- {
- if (pFcb->Header.ValidDataLength.QuadPart > pFcb->Header.FileSize.QuadPart)
- {
- liStartingByte = pFcb->Header.ValidDataLength;
- }
- else
- {
- liStartingByte = pFcb->Header.FileSize;
- }
- }
+ {
- //
+ if (pFcb->Header.ValidDataLength.QuadPart > pFcb->Header.FileSize.QuadPart)
+ {
+
+ liStartingByte = pFcb->Header.ValidDataLength;
+ }
+ else
+ {
+
+ liStartingByte = pFcb->Header.FileSize;
+ }
+
+ pIrpSp->Parameters.Write.ByteOffset = liStartingByte;
+ }
+
+ //
// We have the correct lock - even if we don't end up truncating
//
bLockOK = TRUE;