[PATCH 02/16] xfs_repair: warn when we would have rebuilt a directory

Darrick J. Wong
2020-05-09T16:30:08Z

From: Darrick J. Wong <darrick.wong@oracle.com>

longform_dir2_entry_check should warn the user when we would have
rebuilt a directory had -n not been given on the command line. The
missing warning results in repair returning 0 (all clean) when in fact
there were things that it would have fixed.

Found by running xfs/496 against lents[0].hashval = middlebit.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
repair/phase6.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/repair/phase6.c b/repair/phase6.c
index a938e802..75e273c8 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -2426,6 +2426,9 @@ longform_dir2_entry_check(xfs_mount_t *mp,
*num_illegal = 0;
*need_dot = 0;
} else {
+ if (fixit || dotdot_update)
+ do_warn(
+ _("would rebuild directory inode %" PRIu64 "\n"), ino);
for (i = 0; i < num_bps; i++)
if (bplist[i])
libxfs_buf_relse(bplist[i]);