From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Carlos Maiolino <cem@kernel.org>,
linux-xfs@vger.kernel.org,
xfs-stable <xfs-stable@lists.linux.dev>,
stable@vger.kernel.org, david.flynn@oracle.com
Subject: Re: [PATCH] xfs: fix online repair probing when CONFIG_XFS_ONLINE_REPAIR=n
Date: Tue, 14 Jan 2025 22:20:37 -0800 [thread overview]
Message-ID: <20250115062037.GF3557553@frogsfrogsfrogs> (raw)
In-Reply-To: <20250115060615.GA29387@lst.de>
On Wed, Jan 15, 2025 at 07:06:15AM +0100, Christoph Hellwig wrote:
> On Tue, Jan 14, 2025 at 02:48:19PM -0800, Darrick J. Wong wrote:
> > index 950f5a58dcd967..09468f50781b24 100644
> > --- a/fs/xfs/scrub/scrub.c
> > +++ b/fs/xfs/scrub/scrub.c
> > @@ -149,6 +149,15 @@ xchk_probe(
> > if (xchk_should_terminate(sc, &error))
> > return error;
> >
> > + /*
> > + * If the caller is probing to see if repair works, set the CORRUPT
> > + * flag (without any of the usual tracing/logging) to force us into
> > + * the repair codepaths. If repair is compiled into the kernel, we'll
> > + * call xrep_probe and simulate a repair; otherwise, the repair
> > + * codepaths return EOPNOTSUPP.
> > + */
> > + if (xchk_could_repair(sc))
> > + sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
>
> Stupid question: what is the point in not just directly returning
> -EOPNOTSUPP here when online repair is not supported?
Good point, we could cut it off right then and there. Though this seems
a little gross:
if (xchk_could_repair(sc))
#ifdef CONFIG_XFS_ONLINE_REPAIR
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
#else
return -EOPNOTSUPP;
#endif
return 0;
but I don't mind. Some day the stubs will go away, fingers crossed.
--D
next prev parent reply other threads:[~2025-01-15 6:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-14 22:48 [PATCH] xfs: fix online repair probing when CONFIG_XFS_ONLINE_REPAIR=n Darrick J. Wong
2025-01-15 6:06 ` Christoph Hellwig
2025-01-15 6:20 ` Darrick J. Wong [this message]
2025-01-15 6:27 ` Christoph Hellwig
2025-01-15 6:29 ` 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=20250115062037.GF3557553@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=david.flynn@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=xfs-stable@lists.linux.dev \
/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