]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: include any realloc'ed buffers in final putbuf
authorMike Grant <mggr@pml.ac.uk>
Thu, 30 Jul 2015 23:14:58 +0000 (09:14 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 30 Jul 2015 23:14:58 +0000 (09:14 +1000)
The realloc code included in commit 95dff16b1 potentially introduces
extra buffers to bplist.  These should be dealt with at the end of the
longform_dir2_entry_check function.  This replaces the originally estimated
number of entries (freetab->naents) with the actual number finally allocated
(num_bps).

Signed-off-by: Mike Grant <mggr@pml.ac.uk>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
repair/phase6.c

index 5817743e117e3cc156a8256cf953f721c2b7a46f..1f82c3d09b15b37655cb1abcb9caa654fa2b1325 100644 (file)
@@ -2407,14 +2407,14 @@ longform_dir2_entry_check(xfs_mount_t   *mp,
 out_fix:
        if (!no_modify && (fixit || dotdot_update)) {
                dir_hash_dup_names(hashtab);
-               for (i = 0; i < freetab->naents; i++)
+               for (i = 0; i < num_bps; i++)
                        if (bplist[i])
                                libxfs_putbuf(bplist[i]);
                longform_dir2_rebuild(mp, ino, ip, irec, ino_offset, hashtab);
                *num_illegal = 0;
                *need_dot = 0;
        } else {
-               for (i = 0; i < freetab->naents; i++)
+               for (i = 0; i < num_bps; i++)
                        if (bplist[i])
                                libxfs_putbuf(bplist[i]);
        }