https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ea6b9622c4328b1d3c5119...
commit ea6b9622c4328b1d3c51196edf004febb12dd68b Author: Trevor Thompson tmt256@email.vccs.edu AuthorDate: Sun Jun 12 04:02:52 2016 +0000
[NTFS] Add fixes to WriteAttribute(): -Remove erroneous check for end of run (before writing to the last run returned) -Properly dereference RealLengthWritten pointer, as reported in CR-90
svn path=/branches/GSoC_2016/NTFS/; revision=71616 --- drivers/filesystems/ntfs/mft.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/drivers/filesystems/ntfs/mft.c b/drivers/filesystems/ntfs/mft.c index 43b38ef2ab..1294264e69 100644 --- a/drivers/filesystems/ntfs/mft.c +++ b/drivers/filesystems/ntfs/mft.c @@ -517,17 +517,6 @@ WriteAttribute(PDEVICE_EXTENSION Vcb, } else DataRunStartLCN = -1; - - if (*DataRun == 0) - { - if (Length == 0) - return STATUS_SUCCESS; - - // This code shouldn't execute, because we should have extended the allocation size - // or failed the request by now. It's just a sanity check. - DPRINT1("Encountered EOF before expected!\n"); - return STATUS_END_OF_FILE; - } }
// Do we have more data to write? @@ -556,7 +545,7 @@ WriteAttribute(PDEVICE_EXTENSION Vcb,
Length -= WriteLength; SourceBuffer += WriteLength; - RealLengthWritten += WriteLength; + *RealLengthWritten += WriteLength;
// We finished this request, but there's still data in this data run. if (Length == 0 && WriteLength != DataRunLength * Vcb->NtfsInfo.BytesPerCluster)