xfs_repair: fix messaging when shortform_dir2_junk is called
This function is called when we've decide to junk a shortform directory
entry. This is obviously corruption of some kind, so we should always
say something, particularly if we're in !verbose repair mode.
Otherwise, if we're in non-verbose repair mode, we print things like:
entry "FOO" in shortform directory XXX references non-existent inode YYY
Without telling the sysadmin that we're removing the dirent.
Fixes: aaca101b1ae ("xfs_repair: add support for validating dirent ftype field")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
diff --git a/repair/phase6.c b/repair/phase6.c
index 3947018..a457429 100644
--- a/repair/phase6.c
+++ b/repair/phase6.c
@@ -2441,10 +2441,7 @@
*/
(*index)--;
- if (verbose)
- do_warn(_("junking entry\n"));
- else
- do_warn("\n");
+ do_warn(_("junking entry\n"));
return sfep;
}
@@ -2593,7 +2590,7 @@
if (irec == NULL) {
do_warn(
- _("entry \"%s\" in shortform directory %" PRIu64 " references non-existent inode %" PRIu64 "\n"),
+ _("entry \"%s\" in shortform directory %" PRIu64 " references non-existent inode %" PRIu64 ", "),
fname, ino, lino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep, lino,
&max_size, &i, &bytes_deleted,
@@ -2610,7 +2607,7 @@
*/
if (is_inode_free(irec, ino_offset)) {
do_warn(
- _("entry \"%s\" in shortform directory inode %" PRIu64 " points to free inode %" PRIu64 "\n"),
+ _("entry \"%s\" in shortform directory inode %" PRIu64 " points to free inode %" PRIu64 ", "),
fname, ino, lino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep, lino,
&max_size, &i, &bytes_deleted,
@@ -2626,7 +2623,7 @@
*/
if (!inode_isadir(irec, ino_offset)) {
do_warn(
- _("%s (ino %" PRIu64 ") in root (%" PRIu64 ") is not a directory"),
+ _("%s (ino %" PRIu64 ") in root (%" PRIu64 ") is not a directory, "),
ORPHANAGE, lino, ino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep,
lino, &max_size, &i,
@@ -2648,7 +2645,7 @@
lino, sfep->namelen, sfep->name,
libxfs_dir2_sf_get_ftype(mp, sfep))) {
do_warn(
-_("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name"),
+_("entry \"%s\" (ino %" PRIu64 ") in dir %" PRIu64 " is a duplicate name, "),
fname, lino, ino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep, lino,
&max_size, &i, &bytes_deleted,
@@ -2673,7 +2670,7 @@
if (is_inode_reached(irec, ino_offset)) {
do_warn(
_("entry \"%s\" in directory inode %" PRIu64
- " references already connected inode %" PRIu64 ".\n"),
+ " references already connected inode %" PRIu64 ", "),
fname, ino, lino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep,
lino, &max_size, &i,
@@ -2697,7 +2694,7 @@
do_warn(
_("entry \"%s\" in directory inode %" PRIu64
" not consistent with .. value (%" PRIu64
- ") in inode %" PRIu64 ",\n"),
+ ") in inode %" PRIu64 ", "),
fname, ino, parent, lino);
next_sfep = shortform_dir2_junk(mp, sfp, sfep,
lino, &max_size, &i,