mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Fixed the computation of highest_vcn when applying a runlist fixup
When a file is partially truncated, the highest_vcn has to be recomputed before the file size is adjusted. As a consequence the unmapped run inserted at the end of runlist to match the file size should not be taken into account when determining the higest_vcn.
This commit is contained in:
parent
1797ab5ecd
commit
5be0b9f62a
@ -806,7 +806,9 @@ static int adjust_high_vcn(ntfs_volume *vol, ATTR_RECORD *attr)
|
|||||||
rl = ntfs_mapping_pairs_decompress(vol, attr, (runlist_element*)NULL);
|
rl = ntfs_mapping_pairs_decompress(vol, attr, (runlist_element*)NULL);
|
||||||
if (rl) {
|
if (rl) {
|
||||||
xrl = rl;
|
xrl = rl;
|
||||||
while (xrl->length)
|
if (xrl->length)
|
||||||
|
xrl++;
|
||||||
|
while ((xrl->length) && (xrl->lcn != LCN_RL_NOT_MAPPED))
|
||||||
xrl++;
|
xrl++;
|
||||||
high_vcn = xrl->vcn - 1;
|
high_vcn = xrl->vcn - 1;
|
||||||
attr->highest_vcn = cpu_to_sle64(high_vcn);
|
attr->highest_vcn = cpu_to_sle64(high_vcn);
|
||||||
|
Loading…
Reference in New Issue
Block a user