]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: warn when we would have rebuilt a directory
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 10 Jul 2020 19:35:36 +0000 (15:35 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 10 Jul 2020 19:35:36 +0000 (15:35 -0400)
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>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase6.c

index 5e3b394a2efce5655945df24d783ae449e46fd37..b6391326e48cb5ed0c8a2c4544c1424506f4469a 100644 (file)
@@ -2425,6 +2425,9 @@ out_fix:
                *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]);