ntfs-3g_apply.c: fix inode reuse
authorEric Biggers <ebiggers3@gmail.com>
Sat, 27 Jun 2015 21:17:08 +0000 (16:17 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 27 Jun 2015 23:01:02 +0000 (18:01 -0500)
NTFS inodes were not being reused as intended following commit 26a90546f2
("ntfs-3g_apply.c: Do not use i_visited").

src/ntfs-3g_apply.c

index a6c50c2..dc61e47 100644 (file)
@@ -795,8 +795,7 @@ ntfs_3g_open_inode(struct wim_inode *inode, struct ntfs_3g_apply_ctx *ctx)
        if (unlikely(inode->i_num_streams > 1)) {
                for (unsigned i = 0; i < ctx->num_open_inodes; i++) {
                        if (ctx->open_inodes[i]->mft_no == inode->i_mft_no) {
-                               ni = ctx->open_inodes[i];
-                               goto have_inode;
+                               return ctx->open_inodes[i];
                        }
                }
        }
@@ -809,7 +808,6 @@ ntfs_3g_open_inode(struct wim_inode *inode, struct ntfs_3g_apply_ctx *ctx)
                return NULL;
        }
 
-have_inode:
        ctx->open_inodes[ctx->num_open_inodes++] = ni;
        return ni;
 }