]> wimlib.net Git - wimlib/commitdiff
Misc. fixes
authorEric Biggers <ebiggers3@gmail.com>
Sun, 26 Aug 2012 18:19:20 +0000 (13:19 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 26 Aug 2012 18:19:20 +0000 (13:19 -0500)
src/dentry.c
src/mount.c
src/ntfs-apply.c

index c84a95655100cd80c634ad542ae7480d6ada93de..3f258b76d9151e8e1e6101d155a900c6fb78e05c 100644 (file)
@@ -478,6 +478,7 @@ int print_dentry(struct dentry *dentry, void *lookup_table)
                        printf("Hash              = 0x"); 
                        print_hash(hash);
                        putchar('\n');
                        printf("Hash              = 0x"); 
                        print_hash(hash);
                        putchar('\n');
+                       putchar('\n');
                }
        }
        for (u16 i = 0; i < dentry->num_ads; i++) {
                }
        }
        for (u16 i = 0; i < dentry->num_ads; i++) {
index 58bbabec6fe8ba15f58846f19dafe4623e16c7ba..6bdd0c459e183f6607c79f3444add204cedf130f 100644 (file)
@@ -1770,12 +1770,34 @@ static int check_lte_refcnt(struct lookup_table_entry *lte, void *ignore)
                lte_group_size++;
        if (lte_group_size > lte->refcnt) {
 #ifdef ENABLE_ERROR_MESSAGES
                lte_group_size++;
        if (lte_group_size > lte->refcnt) {
 #ifdef ENABLE_ERROR_MESSAGES
-               ERROR("The following lookup table entry has a reference count "
+               struct dentry *example_dentry;
+               struct list_head *next;
+               struct stream_list_head *head;
+               WARNING("The following lookup table entry has a reference count "
                      "of %u, but", lte->refcnt);
                      "of %u, but", lte->refcnt);
-               ERROR("We found %u references to it", lte_group_size);
+               WARNING("We found %u references to it", lte_group_size);
+               next = lte->lte_group_list.next;
+               head = container_of(next, struct stream_list_head, list);
+               if (head->type == STREAM_TYPE_NORMAL) {
+                       example_dentry = container_of(head, struct dentry,
+                                                     lte_group_list);
+                       WARNING("(One dentry referencing it is at `%s')",
+                               example_dentry->full_path_utf8);
+               }
                print_lookup_table_entry(lte);
 #endif
                print_lookup_table_entry(lte);
 #endif
+               /* Guess what!  install.wim for Windows 8 contains a stream with
+                * 2 dentries referencing it, but the lookup table entry has
+                * reference count of 1.  So we will need to handle this case
+                * and not just make it be an error...  I'm just setting the
+                * reference count to the number of references we found. */
+
+               #if 1
+               lte->refcnt = lte_group_size;
+               WARNING("Fixing reference count");
+               #else
                return WIMLIB_ERR_INVALID_DENTRY;
                return WIMLIB_ERR_INVALID_DENTRY;
+               #endif
        }
        return 0;
 }
        }
        return 0;
 }
index 3ac622919c683c674859777d0a20c0bff0fcd96f..d3457fb894bfc6677a1c75dcaac33cf4a7d5d9a0 100644 (file)
@@ -305,7 +305,8 @@ static int preapply_dentry_with_dos_name(struct dentry *dentry,
                char orig;
                ntfs_volume *vol = (*dir_ni_p)->vol;
 
                char orig;
                ntfs_volume *vol = (*dir_ni_p)->vol;
 
-               DEBUG("pre-applying DOS name `%s'", dentry_with_dos_name);
+               DEBUG("pre-applying DOS name `%s'",
+                     dentry_with_dos_name->full_path_utf8);
                ret = do_wim_apply_dentry_ntfs(dentry_with_dos_name,
                                               *dir_ni_p, w);
                if (ret != 0)
                ret = do_wim_apply_dentry_ntfs(dentry_with_dos_name,
                                               *dir_ni_p, w);
                if (ret != 0)
@@ -364,8 +365,11 @@ static int do_wim_apply_dentry_ntfs(struct dentry *dentry, ntfs_inode *dir_ni,
                        if (other->extracted_file) {
                                ret = wim_apply_hardlink_ntfs(dentry, other,
                                                              dir_ni, &ni);
                        if (other->extracted_file) {
                                ret = wim_apply_hardlink_ntfs(dentry, other,
                                                              dir_ni, &ni);
+                               is_hardlink = true;
                                if (ret != 0)
                                if (ret != 0)
-                                       return ret;
+                                       goto out_close_dir_ni;
+                               else
+                                       goto out_set_dos_name;
                        }
                }
                /* Can't make a hard link */
                        }
                }
                /* Can't make a hard link */