Fixes
authorEric Biggers <ebiggers3@gmail.com>
Mon, 20 Aug 2012 17:24:46 +0000 (12:24 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Mon, 20 Aug 2012 17:24:46 +0000 (12:24 -0500)
- Fix lte_decrement_refcnt() assertion
- Assign inode numbers to new directories

src/lookup_table.c
src/mount.c

index 9edde937d54f87d429b787a429b567121e641bcc..66c4670076f61dfabf8e278d91caef7d3276f427 100644 (file)
@@ -163,12 +163,14 @@ lookup_table_decrement_refcnt(struct lookup_table* table, const u8 hash[])
 struct lookup_table_entry *
 lte_decrement_refcnt(struct lookup_table_entry *lte, struct lookup_table *table)
 {
-       wimlib_assert(lte->refcnt);
-       if (lte && --lte->refcnt == 0) {
-               lookup_table_unlink(table, lte);
-               if (lte->num_opened_fds == 0) {
-                       free_lookup_table_entry(lte);
-                       lte = NULL;
+       if (lte) {
+               wimlib_assert(lte->refcnt);
+               if (--lte->refcnt == 0) {
+                       lookup_table_unlink(table, lte);
+                       if (lte->num_opened_fds == 0) {
+                               free_lookup_table_entry(lte);
+                               lte = NULL;
+                       }
                }
        }
        return lte;
index 68909618596997c14b5c10cb0277b48e25c7d809..46da9e74cb534a8371d361f34a5f82b27d1deaa7 100644 (file)
@@ -1039,6 +1039,7 @@ static int wimfs_mkdir(const char *path, mode_t mode)
        newdir = new_dentry(basename);
        newdir->attributes |= FILE_ATTRIBUTE_DIRECTORY;
        newdir->resolved = true;
+       newdir->hard_link = next_link_group_id++;
        link_dentry(newdir, parent);
        return 0;
 }