From f847472bcb4fb6b766fcdebfe88ebaa01a5bce63 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 22 May 2013 01:46:48 -0500 Subject: [PATCH] wimlib_mount_image(): Resolve inodes per-lookup, -EIO when streams not found --- src/lookup_table.c | 5 +++-- src/mount_image.c | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lookup_table.c b/src/lookup_table.c index 47e60388..c1bd00d3 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -837,7 +837,9 @@ lookup_resource(WIMStruct *w, inode = dentry->d_inode; - wimlib_assert(inode->i_resolved); + if (!inode->i_resolved) + if (inode_resolve_ltes(inode, w->lookup_table)) + return -EIO; if (!(lookup_flags & LOOKUP_FLAG_DIRECTORY_OK) && inode_is_directory(inode)) @@ -895,7 +897,6 @@ wim_resource_compression_type(const struct wim_lookup_table_entry *lte) int inode_resolve_ltes(struct wim_inode *inode, struct wim_lookup_table *table) { - int ret; const u8 *hash; if (!inode->i_resolved) { diff --git a/src/mount_image.c b/src/mount_image.c index 08836382..a207b42a 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -2533,12 +2533,8 @@ wimlib_mount_image(WIMStruct *wim, int image, const char *dir, * assign inode numbers */ DEBUG("Resolving lookup table entries and assigning inode numbers"); ctx.next_ino = 1; - image_for_each_inode(inode, imd) { - ret = inode_resolve_ltes(inode, wim->lookup_table); - if (ret) - goto out_delete_staging_dir; + image_for_each_inode(inode, imd) inode->i_ino = ctx.next_ino++; - } DEBUG("(next_ino = %"PRIu64")", ctx.next_ino); DEBUG("Calling fuse_main()"); @@ -2562,7 +2558,6 @@ wimlib_mount_image(WIMStruct *wim, int image, const char *dir, /* Try to delete the staging directory if a deletion wasn't yet * attempted due to an earlier error */ -out_delete_staging_dir: if (ctx.staging_dir_name) delete_staging_dir(&ctx); out_free_dir_copy: -- 2.43.0