mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-12-04 15:34:28 +08:00
Fixed close() after a fragmented truncate of a compressed file
This commit is contained in:
parent
cc4b358383
commit
ba083200aa
@ -2135,10 +2135,16 @@ int ntfs_attr_pclose(ntfs_attr *na)
|
|||||||
* length.
|
* length.
|
||||||
*/
|
*/
|
||||||
compressed_part = 0;
|
compressed_part = 0;
|
||||||
if ((rl->lcn >= 0) && (rl[1].lcn == (LCN)LCN_HOLE))
|
if (rl->lcn >= 0) {
|
||||||
compressed_part
|
runlist_element *xrl;
|
||||||
= na->compression_block_clusters - rl[1].length;
|
|
||||||
else
|
xrl = rl;
|
||||||
|
do {
|
||||||
|
xrl++;
|
||||||
|
} while (xrl->lcn >= 0);
|
||||||
|
compressed_part = (-xrl->length)
|
||||||
|
& (na->compression_block_clusters - 1);
|
||||||
|
} else
|
||||||
if (rl->lcn == (LCN)LCN_HOLE) {
|
if (rl->lcn == (LCN)LCN_HOLE) {
|
||||||
if (rl->length < na->compression_block_clusters)
|
if (rl->length < na->compression_block_clusters)
|
||||||
compressed_part
|
compressed_part
|
||||||
|
Loading…
Reference in New Issue
Block a user