From 0b8b7521a42f03ec744526d31ea9bfe036222b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 30 Aug 2011 16:02:32 +0200 Subject: [PATCH] Fixed the FullyMapped flag when making an attribute resident When an attribute is truncated and made resident, the NAttrFullyMapped flags has to be cleared, otherwise the attribute cannot be properly mapped when the attribute is later made non-resident again. --- libntfs-3g/attrib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 7a8dbe2b..1d5eb57b 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -4880,6 +4880,7 @@ cluster_free_err_out: ntfs_log_trace("Eeek! Failed to release allocated clusters in error " "code path. Leaving inconsistent metadata...\n"); NAttrClearNonResident(na); + NAttrClearFullyMapped(na); na->allocated_size = na->data_size; na->rl = NULL; free(rl); @@ -5362,6 +5363,7 @@ static int ntfs_attr_make_resident(ntfs_attr *na, ntfs_attr_search_ctx *ctx) /* Update in-memory struct ntfs_attr. */ NAttrClearNonResident(na); + NAttrClearFullyMapped(na); NAttrClearSparse(na); NAttrClearEncrypted(na); na->initialized_size = na->data_size;