From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/2] xfs_repair: clear the needsrepair flag
Date: Tue, 19 Jan 2021 09:37:54 -0500 [thread overview]
Message-ID: <20210119143754.GB1646807@bfoster> (raw)
In-Reply-To: <161076029319.3386490.2011901341184065451.stgit@magnolia>
On Fri, Jan 15, 2021 at 05:24:53PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Clear the needsrepair flag, since it's used to prevent mounting of an
> inconsistent filesystem.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
Code/errors look much cleaner. Though looking at the repair code again,
I wonder... if we clear the needsrepair bit and dirty/write the sb in
phase 2 and then xfs_repair happens to crash, do we risk clearing the
bit and thus allowing a potential mount before whatever requisite
metadata updates have been made?
Brian
> repair/agheader.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
>
> diff --git a/repair/agheader.c b/repair/agheader.c
> index 8bb99489..d9b72d3a 100644
> --- a/repair/agheader.c
> +++ b/repair/agheader.c
> @@ -452,6 +452,21 @@ secondary_sb_whack(
> rval |= XR_AG_SB_SEC;
> }
>
> + if (xfs_sb_version_needsrepair(sb)) {
> + if (!no_modify)
> + sb->sb_features_incompat &=
> + ~XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR;
> + if (i == 0) {
> + if (!no_modify)
> + do_warn(
> + _("clearing needsrepair flag and regenerating metadata\n"));
> + else
> + do_warn(
> + _("would clear needsrepair flag and regenerate metadata\n"));
> + }
> + rval |= XR_AG_SB_SEC;
> + }
> +
> return(rval);
> }
>
>
next prev parent reply other threads:[~2021-01-19 15:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-16 1:24 [PATCHSET v2 0/2] xfs: add the ability to flag a fs for repair Darrick J. Wong
2021-01-16 1:24 ` [PATCH 1/2] xfs_db: support the needsrepair feature flag in the version command Darrick J. Wong
2021-01-19 14:37 ` Brian Foster
2021-02-02 21:09 ` Darrick J. Wong
2021-02-03 13:07 ` Brian Foster
2021-02-03 18:30 ` Darrick J. Wong
2021-02-03 19:09 ` Brian Foster
2021-01-16 1:24 ` [PATCH 2/2] xfs_repair: clear the needsrepair flag Darrick J. Wong
2021-01-19 14:37 ` Brian Foster [this message]
2021-01-19 18:15 ` Darrick J. Wong
2021-01-19 19:44 ` Brian Foster
2021-01-19 20:31 ` Darrick J. Wong
2021-01-19 23:49 ` Darrick J. Wong
2021-01-20 4:31 ` [PATCH v2.1 " Darrick J. Wong
2021-01-20 17:38 ` Brian Foster
2021-02-02 22:22 ` Darrick J. Wong
2021-01-20 4:31 ` [PATCH 3/2] xfs_repair: fix unmount error message to have a newline Darrick J. Wong
2021-01-20 17:38 ` Brian Foster
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=20210119143754.GB1646807@bfoster \
--to=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).