From: Darrick J. Wong Date: Wed, 24 Feb 2021 00:09:28 +0000 (-0500) Subject: xfs_db: report the needsrepair flag in check and version commands X-Git-Tag: v5.11.0-rc1~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67b8ca98067a8e3e6fd6ff2be4cc91917ada6645;p=thirdparty%2Fxfsprogs-dev.git xfs_db: report the needsrepair flag in check and version commands Teach the version and check commands to report the presence of the NEEDSREPAIR flag. Signed-off-by: Darrick J. Wong Reviewed-by: Brian Foster Reviewed-by: Allison Henderson Signed-off-by: Eric Sandeen --- diff --git a/db/check.c b/db/check.c index 33736e33e..485e855e8 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 d09f653dc..d7111e92a 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; }