diff mbox series

[03/17] xfs_repair: warn when we would have rebuilt a directory

Message ID 159107192170.313760.304032041602234316.stgit@magnolia (mailing list archive)
State Accepted, archived
Headers show
Series xfs_repair: catch things that xfs_check misses | expand

Commit Message

Darrick J. Wong June 2, 2020, 4:25 a.m. UTC
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 repair/phase6.c |    3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/repair/phase6.c b/repair/phase6.c
index 5e3b394a..b6391326 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -2425,6 +2425,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]);