All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: sandeen@sandeen.net, darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [PATCH 07/16] xfs_repair: tag inobt vs finobt errors properly
Date: Sat, 09 May 2020 09:30:42 -0700	[thread overview]
Message-ID: <158904184198.982941.18130519450590388566.stgit@magnolia> (raw)
In-Reply-To: <158904179213.982941.9666913277909349291.stgit@magnolia>

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

Amend the generic inode btree block scanner function to tag correctly
which tree it's complaining about.  Previously, dubious finobt headers
would be attributed to the "inode btree", which is at best ambiguous
and misleading at worst.

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


diff --git a/repair/scan.c b/repair/scan.c
index 7508f7e8..fff54ecf 100644
--- a/repair/scan.c
+++ b/repair/scan.c
@@ -1949,6 +1949,7 @@ scan_inobt(
 	const struct xfs_buf_ops *ops)
 {
 	struct aghdr_cnts	*agcnts = priv;
+	char			*name;
 	xfs_agino_t		lastino = 0;
 	int			i;
 	int			numrecs;
@@ -1961,17 +1962,32 @@ scan_inobt(
 
 	hdr_errors = 0;
 
+	switch (magic) {
+	case XFS_FIBT_MAGIC:
+	case XFS_FIBT_CRC_MAGIC:
+		name = "fino";
+		break;
+	case XFS_IBT_MAGIC:
+	case XFS_IBT_CRC_MAGIC:
+		name = "ino";
+		break;
+	default:
+		name = "(unknown)";
+		assert(0);
+		break;
+	}
+
 	if (be32_to_cpu(block->bb_magic) != magic) {
-		do_warn(_("bad magic # %#x in inobt block %d/%d\n"),
-			be32_to_cpu(block->bb_magic), agno, bno);
+		do_warn(_("bad magic # %#x in %sbt block %d/%d\n"),
+			be32_to_cpu(block->bb_magic), name, agno, bno);
 		hdr_errors++;
 		bad_ino_btree = 1;
 		if (suspect)
 			return;
 	}
 	if (be16_to_cpu(block->bb_level) != level) {
-		do_warn(_("expected level %d got %d in inobt block %d/%d\n"),
-			level, be16_to_cpu(block->bb_level), agno, bno);
+		do_warn(_("expected level %d got %d in %sbt block %d/%d\n"),
+			level, be16_to_cpu(block->bb_level), name, agno, bno);
 		hdr_errors++;
 		bad_ino_btree = 1;
 		if (suspect)
@@ -1993,8 +2009,8 @@ scan_inobt(
 	default:
 		set_bmap(agno, bno, XR_E_MULT);
 		do_warn(
-_("inode btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
-			state, agno, bno, suspect);
+_("%sbt btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
+			name, state, agno, bno, suspect);
 	}
 
 	numrecs = be16_to_cpu(block->bb_numrecs);
@@ -2016,8 +2032,8 @@ _("inode btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
 
 		if (hdr_errors)  {
 			bad_ino_btree = 1;
-			do_warn(_("dubious inode btree block header %d/%d\n"),
-				agno, bno);
+			do_warn(_("dubious %sbt btree block header %d/%d\n"),
+				name, agno, bno);
 			suspect++;
 		}
 
@@ -2038,8 +2054,8 @@ _("inode btree block claimed (state %d), agno %d, bno %d, suspect %d\n"),
 			startino = be32_to_cpu(rp[i].ir_startino);
 			if (i > 0 && startino <= lastino)
 				do_warn(_(
-	"out-of-order ino btree record %d (%u) block %u/%u\n"),
-						i, startino, agno, bno);
+	"out-of-order %s btree record %d (%u) block %u/%u\n"),
+						name, i, startino, agno, bno);
 			else
 				lastino = startino + XFS_INODES_PER_CHUNK - 1;
 


  parent reply	other threads:[~2020-05-09 16:32 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-09 16:29 [PATCH 00/16] xfs_repair: catch things that xfs_check misses Darrick J. Wong
2020-05-09 16:29 ` [PATCH 01/16] xfs_repair: fix missing dir buffer corruption checks Darrick J. Wong
2020-05-09 17:08   ` Christoph Hellwig
2020-05-11 16:44     ` Darrick J. Wong
2020-05-11 17:36       ` Darrick J. Wong
2020-05-12 17:29   ` [PATCH v2 " Darrick J. Wong
2020-05-13  6:22     ` Christoph Hellwig
2020-05-13 15:35       ` Darrick J. Wong
2020-05-09 16:30 ` [PATCH 02/16] xfs_repair: warn when we would have rebuilt a directory Darrick J. Wong
2020-05-09 17:09   ` Christoph Hellwig
2020-05-09 16:30 ` [PATCH 03/16] xfs_repair: check for AG btree records that would wrap around Darrick J. Wong
2020-05-09 17:09   ` Christoph Hellwig
2020-05-09 16:30 ` [PATCH 04/16] xfs_repair: fix bnobt and refcountbt record order checks Darrick J. Wong
2020-05-09 17:10   ` Christoph Hellwig
2020-05-09 16:30 ` [PATCH 05/16] xfs_repair: check for out-of-order inobt records Darrick J. Wong
2020-05-09 17:11   ` Christoph Hellwig
2020-05-09 16:30 ` [PATCH 06/16] xfs_repair: fix rmapbt record order check Darrick J. Wong
2020-05-10  7:33   ` Christoph Hellwig
2020-05-09 16:30 ` Darrick J. Wong [this message]
2020-05-09 17:14   ` [PATCH 07/16] xfs_repair: tag inobt vs finobt errors properly Christoph Hellwig
2020-05-09 16:30 ` [PATCH 08/16] xfs_repair: complain about bad interior btree pointers Darrick J. Wong
2020-05-09 17:15   ` Christoph Hellwig
2020-05-09 16:30 ` [PATCH 09/16] xfs_repair: convert to libxfs_verify_agbno Darrick J. Wong
2020-05-09 17:18   ` Christoph Hellwig
2020-05-11 16:22     ` Darrick J. Wong
2020-05-12  8:07       ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 10/16] xfs_repair: refactor verify_dfsbno_range Darrick J. Wong
2020-05-10  7:24   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 11/16] xfs_repair: remove verify_dfsbno Darrick J. Wong
2020-05-10  7:24   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 12/16] xfs_repair: remove verify_aginum Darrick J. Wong
2020-05-10  7:25   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 13/16] xfs_repair: mark entire free space btree record as free1 Darrick J. Wong
2020-05-10  7:26   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 14/16] xfs_repair: complain about free space only seen by one btree Darrick J. Wong
2020-05-10  7:26   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 15/16] xfs_repair: complain about extents in unknown state Darrick J. Wong
2020-05-10  7:27   ` Christoph Hellwig
2020-05-09 16:31 ` [PATCH 16/16] xfs_repair: complain about any nonzero inprogress value, not just 1 Darrick J. Wong
2020-05-10  7:27   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158904184198.982941.18130519450590388566.stgit@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.