From b20d1020fcf0af3f269595d17d8c7eeb4e97f545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 28 May 2010 16:32:28 +0200 Subject: [PATCH] Fixed data size after an upsizing truncate of a compressed file --- libntfs-3g/attrib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 48906157..3f007820 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -1741,8 +1741,10 @@ s64 ntfs_attr_pwrite(ntfs_attr *na, const s64 pos, s64 count, const void *b) ctx->attr->initialized_size = cpu_to_sle64(pos + count); /* fix data_size for compressed files */ - if (compressed) + if (compressed) { + na->data_size = pos + count; ctx->attr->data_size = ctx->attr->initialized_size; + } if (ntfs_mft_record_write(vol, ctx->ntfs_ino->mft_no, ctx->mrec)) { /*