Mapped the runlist when filling an initial hole

A bug was introduced by commit d2c7d40a2b :
when the beginning of a file was a hole and the runlist span over several
MFT extents, the runlist was not mapped on filling the initial hole.
This lead to a crash when using torrent to download big files.
edge.strict_endians
Jean-Pierre André 2014-04-12 09:32:59 +02:00
parent 8f20ca0d94
commit 25d0f163ee
1 changed files with 4 additions and 3 deletions

View File

@ -1272,9 +1272,10 @@ static int ntfs_attr_fill_hole(ntfs_attr *na, s64 count, s64 *ofs,
goto err_out;
} else {
/* make sure the run ahead of hole is mapped */
if (((*rl)->lcn == LCN_HOLE) && cur_vcn) {
if (ntfs_attr_map_partial_runlist(na, cur_vcn - 1))
goto err_out;
if ((*rl)->lcn == LCN_HOLE) {
if (ntfs_attr_map_partial_runlist(na,
(cur_vcn ? cur_vcn - 1 : cur_vcn)))
goto err_out;
}
}
#else