wimlib_mount_image(): Resolve inodes per-lookup, -EIO when streams not found
authorEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 06:46:48 +0000 (01:46 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Wed, 22 May 2013 06:46:48 +0000 (01:46 -0500)
src/lookup_table.c
src/mount_image.c

index 47e6038..c1bd00d 100644 (file)
@@ -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) {
index 0883638..a207b42 100644 (file)
@@ -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: