From 5c4532b99b8b8cdba7f2a99fd259257446608bb4 Mon Sep 17 00:00:00 2001 From: Mike Grant Date: Thu, 2 Jul 2015 14:36:57 +1000 Subject: [PATCH] xfs_repair: include any realloc'ed buffers in final putbuf 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 Reviewed-by: Christoph Hellwig Signed-off-by: Dave Chinner --- repair/phase6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repair/phase6.c b/repair/phase6.c index 5817743e1..1f82c3d09 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -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]); } -- 2.47.2