Skip to content

Commit 052378a

Browse files
committed
Merge tag 'metadir-6.13_2024-11-05' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into staging-merge
xfs: enable metadir [v5.5 09/10] Actually enable this very large feature, which adds metadata directory trees, allocation groups on the realtime volume, persistent quota options, and quota for realtime files. With a bit of luck, this should all go splendidly. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2 parents 8ca118e + ea079ef commit 052378a

File tree

2 files changed

+26
-13
lines changed

2 files changed

+26
-13
lines changed

fs/xfs/libxfs/xfs_format.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ xfs_sb_has_ro_compat_feature(
403403
XFS_SB_FEAT_INCOMPAT_NEEDSREPAIR | \
404404
XFS_SB_FEAT_INCOMPAT_NREXT64 | \
405405
XFS_SB_FEAT_INCOMPAT_EXCHRANGE | \
406-
XFS_SB_FEAT_INCOMPAT_PARENT)
406+
XFS_SB_FEAT_INCOMPAT_PARENT | \
407+
XFS_SB_FEAT_INCOMPAT_METADIR)
407408

408409
#define XFS_SB_FEAT_INCOMPAT_UNKNOWN ~XFS_SB_FEAT_INCOMPAT_ALL
409410
static inline bool

fs/xfs/scrub/agheader.c

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ xchk_superblock(
147147
if (xfs_has_metadir(sc->mp)) {
148148
if (sb->sb_metadirino != cpu_to_be64(mp->m_sb.sb_metadirino))
149149
xchk_block_set_preen(sc, bp);
150-
}
151-
152-
if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
153-
xchk_block_set_preen(sc, bp);
150+
} else {
151+
if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
152+
xchk_block_set_preen(sc, bp);
154153

155-
if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino))
156-
xchk_block_set_preen(sc, bp);
154+
if (sb->sb_rsumino != cpu_to_be64(mp->m_sb.sb_rsumino))
155+
xchk_block_set_preen(sc, bp);
156+
}
157157

158158
if (sb->sb_rextsize != cpu_to_be32(mp->m_sb.sb_rextsize))
159159
xchk_block_set_corrupt(sc, bp);
@@ -229,11 +229,13 @@ xchk_superblock(
229229
* sb_icount, sb_ifree, sb_fdblocks, sb_frexents
230230
*/
231231

232-
if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino))
233-
xchk_block_set_preen(sc, bp);
232+
if (!xfs_has_metadir(mp)) {
233+
if (sb->sb_uquotino != cpu_to_be64(mp->m_sb.sb_uquotino))
234+
xchk_block_set_preen(sc, bp);
234235

235-
if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino))
236-
xchk_block_set_preen(sc, bp);
236+
if (sb->sb_gquotino != cpu_to_be64(mp->m_sb.sb_gquotino))
237+
xchk_block_set_preen(sc, bp);
238+
}
237239

238240
/*
239241
* Skip the quota flags since repair will force quotacheck.
@@ -349,8 +351,10 @@ xchk_superblock(
349351
if (sb->sb_spino_align != cpu_to_be32(mp->m_sb.sb_spino_align))
350352
xchk_block_set_corrupt(sc, bp);
351353

352-
if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino))
353-
xchk_block_set_preen(sc, bp);
354+
if (!xfs_has_metadir(mp)) {
355+
if (sb->sb_pquotino != cpu_to_be64(mp->m_sb.sb_pquotino))
356+
xchk_block_set_preen(sc, bp);
357+
}
354358

355359
/* Don't care about sb_lsn */
356360
}
@@ -361,6 +365,14 @@ xchk_superblock(
361365
xchk_block_set_corrupt(sc, bp);
362366
}
363367

368+
if (xfs_has_metadir(mp)) {
369+
if (sb->sb_rgcount != cpu_to_be32(mp->m_sb.sb_rgcount))
370+
xchk_block_set_corrupt(sc, bp);
371+
372+
if (sb->sb_rgextents != cpu_to_be32(mp->m_sb.sb_rgextents))
373+
xchk_block_set_corrupt(sc, bp);
374+
}
375+
364376
/* Everything else must be zero. */
365377
if (memchr_inv(sb + 1, 0,
366378
BBTOB(bp->b_length) - sizeof(struct xfs_dsb)))

0 commit comments

Comments
 (0)