if (ext2fs_test_inode_bitmap2(ctx->inode_ea_map, i)) {
ext2fs_icount_store(ctx->inode_count, i, 1);
return 0;
- } else {
- /* Zero the link count so that when inode is linked to
- * lost+found it has correct link count */
- inode->i_links_count = 0;
- e2fsck_write_inode(ctx, i, inode, "disconnect_inode");
- ext2fs_icount_store(ctx->inode_link_info, i, 0);
}
}
* Prompt to reconnect.
*/
if (fix_problem(ctx, PR_4_UNATTACHED_INODE, &pctx)) {
+ if (inode->i_flags & EXT4_EA_INODE_FL) {
+ /* Zero the link count so that when inode is linked to
+ * lost+found it has correct link count */
+ inode->i_links_count = 0;
+ e2fsck_write_inode(ctx, i, inode, "disconnect_inode");
+ ext2fs_icount_store(ctx->inode_link_info, i, 0);
+ }
if (e2fsck_reconnect_file(ctx, i))
ext2fs_unmark_valid(fs);
} else {