From 571c057d05d93996c9bcd41c96db374523c57d7e Mon Sep 17 00:00:00 2001 From: jpandre Date: Fri, 27 Feb 2009 08:15:06 +0000 Subject: [PATCH] Fixed moving the standard information attribute to an extended MFT record (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 50302130..deb14f4a 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -3908,14 +3908,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);