]> wimlib.net Git - wimlib/commitdiff
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 47e6038859fd0b60ed3a2aacf2cd4ed09ed37818..c1bd00d33e3e25caf0bf31dd81f3eeebe51702b2 100644 (file)
@@ -837,7 +837,9 @@ lookup_resource(WIMStruct *w,
 
        inode = dentry->d_inode;
 
 
        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))
 
        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
 inode_resolve_ltes(struct wim_inode *inode, struct wim_lookup_table *table)
 {
-       int ret;
        const u8 *hash;
 
        if (!inode->i_resolved) {
        const u8 *hash;
 
        if (!inode->i_resolved) {
index 088363829bf0cd1376fb73692b585d84ae61de62..a207b42a6fd449e883e30e2f27741e42cf59db0d 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;
         * 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++;
                inode->i_ino = ctx.next_ino++;
-       }
        DEBUG("(next_ino = %"PRIu64")", ctx.next_ino);
 
        DEBUG("Calling fuse_main()");
        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 */
 
        /* 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:
        if (ctx.staging_dir_name)
                delete_staging_dir(&ctx);
 out_free_dir_copy: