All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: sandeen@sandeen.net, djwong@kernel.org
Cc: Brian Foster <bfoster@redhat.com>,
	linux-xfs@vger.kernel.org, bfoster@redhat.com
Subject: [PATCH 03/11] xfs_db: report the needsrepair flag in check and version commands
Date: Thu, 11 Feb 2021 14:59:18 -0800	[thread overview]
Message-ID: <161308435838.3850286.1999965170245294704.stgit@magnolia> (raw)
In-Reply-To: <161308434132.3850286.13801623440532587184.stgit@magnolia>

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 <bfoster@redhat.com>
---
 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;
 }
 


  parent reply	other threads:[~2021-02-11 23:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 22:59 [PATCHSET v5 00/11] xfs: add the ability to flag a fs for repair Darrick J. Wong
2021-02-11 22:59 ` [PATCH 01/11] xfs_admin: clean up string quoting Darrick J. Wong
2021-02-11 23:08   ` Chaitanya Kulkarni
2021-02-11 22:59 ` [PATCH 02/11] xfs_admin: support filesystems with realtime devices Darrick J. Wong
2021-02-11 23:08   ` Chaitanya Kulkarni
2021-02-11 22:59 ` Darrick J. Wong [this message]
2021-02-11 22:59 ` [PATCH 04/11] xfs_db: don't allow label/uuid setting if the needsrepair flag is set Darrick J. Wong
2021-02-11 22:59 ` [PATCH 05/11] xfs_repair: fix unmount error message to have a newline Darrick J. Wong
2021-02-11 23:12   ` Chaitanya Kulkarni
2021-02-11 22:59 ` [PATCH 06/11] xfs_repair: clear quota CHKD flags on the incore superblock too Darrick J. Wong
2021-02-11 22:59 ` [PATCH 07/11] xfs_repair: clear the needsrepair flag Darrick J. Wong
2021-02-11 22:59 ` [PATCH 08/11] xfs_repair: allow setting " Darrick J. Wong
2021-02-11 23:29   ` Eric Sandeen
2021-02-12  0:17     ` Darrick J. Wong
2021-02-12  0:20       ` Eric Sandeen
2021-02-12  1:26         ` Darrick J. Wong
2021-02-12  4:35       ` Darrick J. Wong
2021-02-12 13:35       ` Brian Foster
2021-02-12 18:54         ` Darrick J. Wong
2021-02-11 22:59 ` [PATCH 09/11] xfs_repair: add a testing hook for NEEDSREPAIR Darrick J. Wong
2021-02-11 22:59 ` [PATCH 10/11] xfs_admin: support adding features to V5 filesystems Darrick J. Wong
2021-02-11 23:00 ` [PATCH 11/11] man: mark all deprecated V4 format options Darrick J. Wong

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=161308435838.3850286.1999965170245294704.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=bfoster@redhat.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.