From 1e43ec0fde07f9b668be668f3e9686050f90c7f0 Mon Sep 17 00:00:00 2001 From: szaka Date: Fri, 27 Feb 2009 02:33:05 +0000 Subject: [PATCH] fix: never move the standard information attribute into an extended MFT record (Faisal Puthuparackat, Szabolcs Szakacsits) --- libntfs-3g/attrib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 73747c8a..7eb6772c 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -3920,14 +3920,15 @@ static int ntfs_resident_attr_resize(ntfs_attr *na, const s64 newsize) ntfs_log_perror("%s: Attribute lookup failed 1", __FUNCTION__); goto put_err_out; } - - /* We can't move out attribute list, thus move out others. */ - if (na->type == AT_ATTRIBUTE_LIST) { + /* + * The standard information and attribute list attributes can't be + * moved out from the base MFT record, so try to move out others. + */ + if (na->type==AT_STANDARD_INFORMATION || na->type==AT_ATTRIBUTE_LIST) { ntfs_attr_put_search_ctx(ctx); if (ntfs_inode_free_space(na->ni, offsetof(ATTR_RECORD, non_resident_end) + 8)) { - ntfs_log_perror("Couldn't free space in the MFT record to " - "make attribute list non resident"); + ntfs_log_perror("Could not free space in MFT record"); return -1; } return ntfs_resident_attr_resize(na, newsize);