From: Allison Henderson <allison.henderson@oracle.com>
To: "Darrick J. Wong" <djwong@kernel.org>, sandeen@sandeen.net
Cc: Brian Foster <bfoster@redhat.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 4/7] xfs_db: don't allow label/uuid setting if the needsrepair flag is set
Date: Tue, 23 Feb 2021 13:18:38 -0700 [thread overview]
Message-ID: <6a807b7d-9dd8-ba1f-7713-9996105b2b7a@oracle.com> (raw)
In-Reply-To: <161404924136.425352.783422563005701204.stgit@magnolia>
On 2/22/21 8:00 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> The NEEDSREPAIR flag can be set on filesystems where we /know/ that
> there's something wrong with the metadata and want to force the sysadmin
> to run xfs_repair before the next mount. The goal here is to prevent
> non-repair changes to a filesystem when we are confident of its
> instability. Normally we wouldn't bother with such safety checks for
> the debugger, but the label and uuid functions can be called from
> xfs_admin, so we should prevent these administrative tasks until the
> filesystem can be repaired.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> Reviewed-by: Brian Foster <bfoster@redhat.com>
ok, makes sense
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> ---
> db/sb.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
>
> diff --git a/db/sb.c b/db/sb.c
> index d7111e92..cec7dce9 100644
> --- a/db/sb.c
> +++ b/db/sb.c
> @@ -379,6 +379,11 @@ uuid_f(
> progname);
> return 0;
> }
> + if (xfs_sb_version_needsrepair(&mp->m_sb)) {
> + dbprintf(_("%s: filesystem needs xfs_repair\n"),
> + progname);
> + return 0;
> + }
>
> if (!strcasecmp(argv[1], "generate")) {
> platform_uuid_generate(&uu);
> @@ -543,6 +548,12 @@ label_f(
> return 0;
> }
>
> + if (xfs_sb_version_needsrepair(&mp->m_sb)) {
> + dbprintf(_("%s: filesystem needs xfs_repair\n"),
> + progname);
> + return 0;
> + }
> +
> dbprintf(_("writing all SBs\n"));
> for (ag = 0; ag < mp->m_sb.sb_agcount; ag++)
> if ((p = do_label(ag, argv[1])) == NULL) {
>
next prev parent reply other threads:[~2021-02-23 20:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-23 3:00 [PATCHSET v6 0/7] xfsprogs: add the ability to flag a fs for repair Darrick J. Wong
2021-02-23 3:00 ` [PATCH 1/7] xfs_admin: clean up string quoting Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
2021-02-23 3:00 ` [PATCH 2/7] xfs_admin: support filesystems with realtime devices Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
2021-02-23 3:00 ` [PATCH 3/7] xfs_db: report the needsrepair flag in check and version commands Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
2021-02-25 8:11 ` Christoph Hellwig
2021-02-23 3:00 ` [PATCH 4/7] xfs_db: don't allow label/uuid setting if the needsrepair flag is set Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson [this message]
2021-02-25 8:13 ` Christoph Hellwig
2021-02-23 3:00 ` [PATCH 5/7] xfs_repair: fix unmount error message to have a newline Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
2021-02-23 3:00 ` [PATCH 6/7] xfs_repair: clear quota CHKD flags on the incore superblock too Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
2021-02-23 3:00 ` [PATCH 7/7] xfs_repair: clear the needsrepair flag Darrick J. Wong
2021-02-23 20:18 ` Allison Henderson
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=6a807b7d-9dd8-ba1f-7713-9996105b2b7a@oracle.com \
--to=allison.henderson@oracle.com \
--cc=bfoster@redhat.com \
--cc=djwong@kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).