Thread (17 messages) 17 messages, 3 authors, 2021-02-25

Re: [PATCH 3/7] xfs_db: report the needsrepair flag in check and version commands

From: Allison Henderson <hidden>
Date: 2021-02-23 20:19:59


On 2/22/21 8:00 PM, Darrick J. Wong wrote:
From: Darrick J. Wong <djwong@kernel.org>

Teach the version and check commands to report the presence of the
NEEDSREPAIR flag.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Brian Foster <redacted>
Looks good
Reviewed-by: Allison Henderson <redacted>
quoted hunk ↗ jump to hunk
---
  db/check.c |    5 +++++
  db/sb.c    |    2 ++
  2 files changed, 7 insertions(+)

diff --git a/db/check.c b/db/check.c
index 33736e33..485e855e 100644
--- a/db/check.c
+++ b/db/check.c
@@ -3970,6 +3970,11 @@ scan_ag(
  			dbprintf(_("mkfs not completed successfully\n"));
  		error++;
  	}
+	if (xfs_sb_version_needsrepair(sb)) {
+		if (!sflag)
+			dbprintf(_("filesystem needs xfs_repair\n"));
+		error++;
+	}
  	set_dbmap(agno, XFS_SB_BLOCK(mp), 1, DBM_SB, agno, XFS_SB_BLOCK(mp));
  	if (sb->sb_logstart && XFS_FSB_TO_AGNO(mp, sb->sb_logstart) == agno)
  		set_dbmap(agno, XFS_FSB_TO_AGBNO(mp, sb->sb_logstart),
diff --git a/db/sb.c b/db/sb.c
index d09f653d..d7111e92 100644
--- a/db/sb.c
+++ b/db/sb.c
@@ -691,6 +691,8 @@ version_string(
  		strcat(s, ",INOBTCNT");
  	if (xfs_sb_version_hasbigtime(sbp))
  		strcat(s, ",BIGTIME");
+	if (xfs_sb_version_needsrepair(sbp))
+		strcat(s, ",NEEDSREPAIR");
  	return s;
  }
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help