fix_true_inode(): Fix bug
authorEric Biggers <ebiggers3@gmail.com>
Fri, 21 Dec 2012 17:58:47 +0000 (11:58 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Fri, 21 Dec 2012 17:58:47 +0000 (11:58 -0600)
NEWS
src/hardlink.c

diff --git a/NEWS b/NEWS
index 1145194..baafaba 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ Version 1.2.2:
        and should now be even faster.  (Although, they were already pretty
        fast--- much faster than typical I/O speeds.)
 
+       Fixed a bug introduced in v1.2.1 that would cause a directory tree
+       containing hard links to be captured incorrectly in some cases.
+
 Version 1.2.1:
        By default, unmounting a read-write mounted WIM with 'imagex unmount
        --commit' will now change the WIM in-place without needing to write the
index 7603670..93030d8 100644 (file)
@@ -278,6 +278,8 @@ static int fix_true_inode(struct inode *inode, struct hlist_head *inode_list)
                                return WIMLIB_ERR_INVALID_DENTRY;
                        }
                        /* Free the unneeded `struct inode'. */
+                       dentry->d_inode->hlist.next = NULL;
+                       dentry->d_inode->hlist.pprev = NULL;
                        free_inode(dentry->d_inode);
                        dentry->d_inode = ref_inode;
                        ref_inode->link_count++;