From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: cem@kernel.org, darrick.wong@oracle.com, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: check v5 superblock features early
Date: Tue, 28 Jul 2026 08:47:30 -0700 [thread overview]
Message-ID: <20260728154730.GS2901224@frogsfrogsfrogs> (raw)
In-Reply-To: <20260728154207.GA10775@lst.de>
On Tue, Jul 28, 2026 at 05:42:07PM +0200, Christoph Hellwig wrote:
> On Tue, Jul 28, 2026 at 08:26:28AM -0700, Darrick J. Wong wrote:
> > On Tue, Jul 28, 2026 at 10:04:35AM +0200, Christoph Hellwig wrote:
> > > When working on a new features that reuses the existing pad in the
> > > superblock, I noticed that mounting such a file system on an old kernel
> > > logs a rather confusing warning:
> > >
> > > XFS (vdc): Metadir superblock padding fields must be zero.
> > >
> > > This is because we only validate the various feature fields in v5
> > > superblocks after the common superblock validation helper is called.
> > >
> > > Fix this by calling the feature validation first. To make this more
> > > obvious, rename xfs_validate_sb_read to xfs_validate_sb_features and only
> > > call it for v5 file systems.
> >
> > Shouldn't it be called xfs_validate_v5_sb_features then?
> >
> > Oh. There's already a xfs_sb_validate_v5_features function that checks
> > that the v4 feature bits are set correctly for a v5 filesystem, and it
> > would be confusing to have both.
>
> Or just stick to the old name :)
>
> > Could we move the code in
> > xfs_validate_sb_read into xfs_sb_validate_v5_features instead?
>
> But yes, that does look sensible as well.
>
> > If you do that, then xfs_sb_good_version will validate the feature bit
> > recognition, which it doesn't do now. I'm not sure what weird side
> > effects might result from that though.
>
> None in the kernel, but userspace has a lot more callers that need a
> careful look.
I /think/ the only visible change to userspace is that the code in
repair that checks v5 feature flag recognition now becomes defunct
because libxfs_sb_good_version will catch it first. But the
xfs_validate_sb_read code will already log (more or less) the same
complaint so I don't think it will have any real effect.
--D
prev parent reply other threads:[~2026-07-28 15:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 8:04 [PATCH] xfs: check v5 superblock features early Christoph Hellwig
2026-07-28 15:26 ` Darrick J. Wong
2026-07-28 15:42 ` Christoph Hellwig
2026-07-28 15:47 ` Darrick J. Wong [this message]
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=20260728154730.GS2901224@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=darrick.wong@oracle.com \
--cc=hch@lst.de \
--cc=linux-xfs@vger.kernel.org \
/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.