diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 5e2d5420..c0cac743 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -3922,6 +3922,15 @@ static int ntfs_resident_attr_resize_i(ntfs_attr *na, const s64 newsize) ntfs_log_perror("%s: Attribute lookup failed 1", __FUNCTION__); goto put_err_out; } + + /* Prefer to add AT_INDEX_ALLOCATION instead of AT_ATTRIBUTE_LIST */ + if (na->type == AT_INDEX_ROOT) { + err = ENOSPC; + ntfs_log_trace("INDEX_ROOT can not be enlarged\n"); + ret = STATUS_RESIDENT_ATTRIBUTE_FILLED_MFT; + goto put_err_out; + } + /* * The standard information and attribute list attributes can't be * moved out from the base MFT record, so try to move out others. diff --git a/libntfs-3g/inode.c b/libntfs-3g/inode.c index 198a02b7..e1c24ce8 100644 --- a/libntfs-3g/inode.c +++ b/libntfs-3g/inode.c @@ -1035,6 +1035,9 @@ retry: ctx->attr->type == AT_DATA) goto retry; + if (ctx->attr->type == AT_INDEX_ROOT) + goto retry; + record_size = le32_to_cpu(ctx->attr->length); if (ntfs_attr_record_move_away(ctx, 0)) {