From 37bd6661d4d5e14743a43d1b6b9945358da94e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 9 Nov 2015 16:09:52 +0100 Subject: [PATCH] Fixed getting space for making an index non resident Under some rare condition there is no space in an MFT entry to make an index non-resident, and the index root has to be moved to an extent. This fix cares for the situation when the attribute list was inserted beforehand. --- libntfs-3g/index.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libntfs-3g/index.c b/libntfs-3g/index.c index d498dde4..d93b1b3d 100644 --- a/libntfs-3g/index.c +++ b/libntfs-3g/index.c @@ -1175,8 +1175,7 @@ retry : * index, we may have to move the root to an extent */ if ((errno == ENOSPC) - && !ctx->al_entry - && !ntfs_inode_add_attrlist(icx->ni)) { + && (ctx->al_entry || !ntfs_inode_add_attrlist(icx->ni))) { ntfs_attr_put_search_ctx(ctx); ctx = (ntfs_attr_search_ctx*)NULL; ir = ntfs_ir_lookup(icx->ni, icx->name, icx->name_len,