]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: disable sparse inode chunk alignment check when there is no alignment
authorDarrick J. Wong <djwong@kernel.org>
Wed, 31 Jan 2024 19:47:14 +0000 (11:47 -0800)
committerChandan Babu R <chandanbabu@kernel.org>
Sat, 17 Feb 2024 03:48:53 +0000 (09:18 +0530)
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.

Fixes: dbfbf3bdf639 ("xfs: repair inode btrees")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/scrub/ialloc_repair.c

index b3f7182dd2f5dd5796b6a399f701bf26f8a2a892..e94f10800082565c069e75a7f865c3d3e81a7063 100644 (file)
@@ -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;