From: "Darrick J. Wong" <djwong@kernel.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>,
Chandan Babu R <chandanrlinux@gmail.com>,
xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: disable sparse inode chunk alignment check when there is no alignment
Date: Wed, 31 Jan 2024 14:11:02 -0800 [thread overview]
Message-ID: <20240131221102.GA616564@frogsfrogsfrogs> (raw)
In-Reply-To: <ZbqzmZs++8RVHk0U@dread.disaster.area>
On Thu, Feb 01, 2024 at 07:54:49AM +1100, Dave Chinner wrote:
> On Wed, Jan 31, 2024 at 11:47:14AM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> >
> > While testing a 64k-blocksize filesystem, I noticed that xfs/709 fails
> > to rebuild the inode btree with a bunch of "Corruption remains"
> > messages. It turns out that when the inode chunk size is smaller than a
> > single filesystem block, no block alignments constraints are necessary
> > for inode chunk allocations, and sb_spino_align is zero. Hence we can
> > skip the check.
>
> Should sparse inodes even be enabled by mkfs in this case?
Probably not, it's totally useless for inopblock <= 64.
> Regardless, if sb_spino_align = 0 then xfs_ialloc_setup_geometry()
> does:
>
> igeo->ialloc_min_blks = igeo->ialloc_blks;
>
> And this turns off sparse inode allocation for this situation....
>
> > Fixes: dbfbf3bdf639 ("xfs: repair inode btrees")
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> > fs/xfs/scrub/ialloc_repair.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/xfs/scrub/ialloc_repair.c b/fs/xfs/scrub/ialloc_repair.c
> > index b3f7182dd2f5d..e94f108000825 100644
> > --- a/fs/xfs/scrub/ialloc_repair.c
> > +++ b/fs/xfs/scrub/ialloc_repair.c
> > @@ -369,7 +369,7 @@ xrep_ibt_check_inode_ext(
> > * On a sparse inode fs, this cluster could be part of a sparse chunk.
> > * Sparse clusters must be aligned to sparse chunk alignment.
> > */
> > - if (xfs_has_sparseinodes(mp) &&
> > + if (xfs_has_sparseinodes(mp) && mp->m_sb.sb_spino_align &&
> > (!IS_ALIGNED(agbno, mp->m_sb.sb_spino_align) ||
> > !IS_ALIGNED(agbno + len, mp->m_sb.sb_spino_align)))
> > return -EFSCORRUPTED;
>
> ... which makes this additional check reasonable.
>
> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Thanks!
--D
>
> --
> Dave Chinner
> david@fromorbit.com
>
next prev parent reply other threads:[~2024-01-31 22:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 19:47 [PATCH] xfs: disable sparse inode chunk alignment check when there is no alignment Darrick J. Wong
2024-01-31 20:54 ` Dave Chinner
2024-01-31 22:11 ` Darrick J. Wong [this message]
2024-02-01 4:17 ` Christoph Hellwig
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=20240131221102.GA616564@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=chandanrlinux@gmail.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox