mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
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.
This commit is contained in:
parent
0b827cc978
commit
0b8b7521a4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user